Zend Studio


Zend Studio php_pdo_mysql.dll error

I started using phpunit, which is built into Zend Studio 7.2. Everything works fine until it encountered a database query that used PDO. The test case will timeout and zend studio will give you the error “Test case was unexpectedly terminated”. It took a lot of digging to find the real error in the windows event viewer:

Faulting application name: php-cgi.exe, version: 5.2.10.10, time stamp: 0x4abb41d8
Faulting module name: php_pdo_mysql.dll, version: 5.2.10.10, time stamp: 0x4ab23077
Exception code: 0xc0000005
Fault offset: 0x00002580
Faulting process id: 0x458
Faulting application start time: 0x01cb16fb91818916
Faulting application path: C:\Program Files (x86)\Zend\Zend Studio – 7.1.0\plugins\org.zend.php.debug.debugger.win32.x86_5.3.7.v20091116\resources\php5\php-cgi.exe
Faulting module path: C:\Program Files (x86)\Zend\Zend Studio – 7.1.0\plugins\org.zend.php.debug.debugger.win32.x86_5.3.7.v20091116\resources\php5\ext\php_pdo_mysql.dll
Report Id: d31816ab-82ee-11df-99ae-00241dd93279

The solution? While I had Zend Server installed and using PHP 5.3, Zend Studio’s internal version was using PHP 5.2.xxx. I’m pretty certain Doctrine, which uses PDO, requires PHP 5.3. I changed Zend Studio to PHP 5.3 and it worked. In Zend Studio, go to Window->preferences->php->debug and ensure the “PHP executable” is set to PHP 5.3. FYI – My “server” on this screen is set to “Local Zend Server”. Hope this helps!


Zend Studio select the local resource that matches the following server path 1

If while debugging with Zend Studio for Eclipse you get the error “select the local resource that matches the following server path” there are two possible solutions.

First, the easy one. If you opened the file from the explorer windows and not through Eclipse, the file is not open in the project so it doesn’t know where the other resources are. The open declaration ability will not work either.

IF that didn’t work, try this next change. If you have external libraries that are used in your application, first add the library to the build path of your project. Then, if you get the pop error while debugging: “select the local resource that matches the following server path” and “get content from the server for the following path”, you must map the paths as explained below.

Adding a Server Location Path Map

This procedure describes how to add a Path Map to a server so that files which are called from a certain location on the server will be searched for in a local location during remote PHP Script debbuging/profiling and PHP Web Page debugging /profiling. This will only apply when the ‘use local copy’ option is selected in the Advanced tab of the PHP Web Page debugging configuration) .

To add a Path Map to a server:

  1. Open the PHP Servers Preferences Page by going to Window | Preferences on the Menu Bar and selecting PHP | PHP Servers from the Preferences list.
  2. Select the server on which you would like to create the Path Map and click Edit.
  3. In the Edit Server dialog, select the Path Mapping tab.
  4. Click Add.
  5. An Add new Path Mapping dialog appears.
  6. Enter the Server Path from which you would like to create the Path Map. Files called from this location will be searched for in the path specified below.
  7. Select either the ‘Path in Workspace’ or ‘Path in File System’ option and click Browse to specify the location.

path_mapping_edit.png

Your
Path Map will be added to your server list.

path_mapping_dialog.png

Path
Mapping Settings

The next time a file is called from the Path on Server, it will
be searched for in the local location you have specified.