SOLUTION: We used Xdebug, phpDesigner 2008 as IDE, SVN. Have a look at this tutorial!
In this tutorial we are going to set up debugging of Typo3 with a php editor like phpDesigner 2008 in Windows XP environment.
Pre-requisites:
Steps to configure the IDE phpDesigner2008:
If all settings are written correctly when you open a page from Firefox like http://localhost/index.php with the "debug mode" activated (see Xdebug helper icon), Firefox will interact with your IDE. In the IDE you can insert breakpoints and Firefox will allow your debugginh the php files of your typo3 installation.
Pre-requisites:
- A local copy of the typo3 installation (located into the apache web root; in Xampp we have it under the htdocs folder)
- Xampp
- PhpDesigner 2008.
- Download XAMPP at http://www.apachefriends.org/en/xampp-windows.html
Click on the saved file and an icon will ask where to extract the files; extract them to c:\Program Files. - The system will save the files into the C:\Program Files\xampp.
Open the folder and click thesetup_xampp.bat; this will configure all files to work correctly in your system like the php.ini needed by apache web server. - Download the Xdebug dll located in http://www.xdebug.org/download.php; the version you have to install is the 5.2 VC6 that will work fine with the latetest release of Xampp (In this guide we refer to Xampp Windows version 1.7.0)
Save the dll file into the folder C:\Program Files\xampp\php\ext\ - Go into the C:\Program Files\xampp\php folder
We need to modify here the php.ini in this way:
- In the [Zend] section comment all the lines putting a;at the line beginning
- In the [Xdebug] section you must have this lines:zend_extension_ts="C:\Program Files\xampp\php\ext\php_xdebug-2.0.4-5.2.8.dll"
xdebug.remote_enable=true
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.profiler_enable=1
xdebug.profiler_output_dir="C:\Program Files\xampp\tmp" - Copy and paste the C:\Program Files\xampp\php\php.ini into C:\Program Files\xampp\apache\bin (overwriting the existing php.ini)
- Open the
C:\Program Files\xampp\xampp-control.exeand a tray icon will appear by which we can control xampp services like mysql and apache. To verify Xampp is working fine open a browser like Firefox and typehttp://localhost/xampp/; if installation goes fine you should see the xampp welcome page. - Go in C:\Program Files\xampp\htdocs and move all existing files in another folder: you can perform this creating a new temporary folder under
htdocsnamed/tempand cut and paste the files under /htdocs into /htdocs/temp. - Copy online Typo3 installation into C:\Program Files\xampp\htdocs. If you use SVN or a CVS, perform a checkout of the typo3 repository.
- Download Firefox add-on located in https://addons.mozilla.org/en-US/firefox/addon/3960
- Once the installation is finished, in Firefox go to the menu Tools -> Add-ons and select the Options button under Xdebug Helper addon to access the setup page.
- In the first text box of the add-on be sure these lines are present:
zend_extension_ts=php_xdebug.dll
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.idekey=default - In the second text box insert phpDesigner2008. This key represents the Xdebug idekey value that allows firefox understanding which integrated development environment (IDE) we will use to start the debug mode (users can install also Eclipse, Netbeans, etc.)
- The extension will insert an icon in the status bar: clicking on it the linkage with Xdebug will be active or disabled.
If the icon is green firefox will run pages in debug mode.
Steps to configure the IDE phpDesigner2008:
- Create the project selecting the folder C:\Program Files\xampp\htdocs; phpDesigner will import all files located under the htdocs folder.
- Open the menu Tools -> Preferences
- Select Debugger and in the PHP panel insert
C:\Program Files\xampp\php\php-cgi.exe, under the Configuration panel insertC:\Program Files\xampp\php\php.ini - Select Run (under debugger) and under the php panel write
C:\Program Files\xampp\php\php-cgi.exeand under configuration panel insertC:\Program Files\xampp\php\php.ini - Select localhost (under debugger) and under Server path write
http://localhostwhile in Local Server Path writeC:\Program Files\xampp\htdocs; the port must be the 80.
If all settings are written correctly when you open a page from Firefox like http://localhost/index.php with the "debug mode" activated (see Xdebug helper icon), Firefox will interact with your IDE. In the IDE you can insert breakpoints and Firefox will allow your debugginh the php files of your typo3 installation.
2 comments:
Nice overview.
One remark though: it works best with XAMPP version 1.7.1.
The php.ini settings in 1.7.2 are different - and Typo3 version 4.2.8 doesn't work correctly with PHP5.3 (in XAMPP 1.7.2).
Ok, thank you for your comment.
Post a Comment