Tag Archives: debugging

Resolution of Ansible Issues on OS X Mavericks

Getting started with Ansible on OS X Mavericks. While following the installation instructions, it broke down on the final step, twice.

It first broke down with the following message (upon entering an empty password):

Then tried entering the password for my logged-in user, which resulted in the following error:

Solution 1: This was resolved with the solution found here.

After this, things were still breaking down, so I turned the -vvvv flag on. Here’s the output with -vvvv flag:

Solution 2: Go to System Preferences > Sharing, and enable Remote Login option:

OS X - Sharing - Remote Login

You will finally get the following output:

That’s all folks.

Laravel Blank (White) Screen of Death on Mac OS X

Kept getting a blank screen / white screen of death upon copy-pasting a new Laravel project from a Windows machine to Mac OS X (Mavericks – PHP 5.4). Nothing helped. No errors were shown or logged. Whoops was not showing either. It was probably a permissions issue, but no debugging help.

Got to the bottom of the issue only after installing a fresh copy of Laravel 4.1:

This emitted the following error upon browsing project in the browser:

That was it: permissions issue!

So here is the solution: set permissions of all files and folders in app/storage. So, go to your project root from Terminal, and enter the following:

That’s it!
 

How to Debug PHP Applications with NetBeans IDE and Xdebug on Windows?

NetBeans logo After having tried many IDEs for PHP development, including Eclipse and Komodo Edit, I have found myself the most comfortable and productive with the excellent NetBeans IDE.

You can start building PHP applications with NetBeans right out-of-the-box by simply downloading NetBeans for PHP (version 6.8 is the latest as of this post). Debugging with it requires an additional download of Xdebug.

Here is a quick and step-by-step guide to quickly start developing and debugging your PHP application projects with NetBeans + Xdebug:

1. Download and install NetBeans IDE for PHP.

2. Download Xdebug (it’s a small DLL library file).

Advice: Among the plethora of download links available on that page, let me tell you that you generally wouldn’t want the ‘non-thread-safe’ version, so ignore that; go for the latest non-beta version. I downloaded 5.2 VC6 (32 bit) of Xdebug 2.0.5.

3. Next you need to make changes to php.ini found in apache\\bin folder (the location of your apache folder may vary depending on your installation, look for it).

Find “[Zend]” section in your php.ini file, which should look like the following:


 

Xdebug is not compatible with Zend Optimizer, so comment out lines 2 to 5 (by prefixing the line with a semi-colon), and add the following lines under [Zend] section heading:


 

Note: Remember to change the path and filename to match your Xdebug path and version.

4. Restart Apache (if using XAMPP: Open the XAMPP Control Panel and first stop, then start Apache).

5. To verify if Xdebug is configured properly for debugging, create a php file containing this one line:


Save it in your htdocs folder [phpinfo.php], and open it in your browser [http://localhost/phpinfo.php]. If Xdebug is loaded successfully, you should see something like this:

Xdebug info with phpinfo()

That is it! Now you are ready to debug your applications with Xdebug using NetBeans IDE. Simply open your PHP project in NetBeans and press Ctrl + F5 or click Debug project button in NetBeans in the toolbar.

A detailed guide on configuring Xdebug with NetBeans can be found on this wiki: http://wiki.netbeans.org/HowToConfigureXDebug.

Happy coding! 🙂