The purpose of this Instructable is to setup a freeware XAMPP webserver on Windows, install a Joomla! Content Management System and finally debug PHP scripts with Eclipse.
How to Install PHP on Windows. PHP, MySQL and other applications in a single installation file, e.g. XAMPP (including a Mac version), WampServer and Web.Developer. There is nothing wrong with.
A Linux Ubuntu Instructable with LAMP is located. You'll get a quick installation guide in 9 detailed steps. At the end of this Instructable, you're ready to debug your own website. Only freeware software will be used.
Question: Do you need a PHP debugger? Answer: When you're developing websites in PHP, then the answer is YES. A debugger can save you a lot of time to find bugs in your PHP scripts, such as Joomla!
Components, modules or plugins. It allows you to step through the code, set breakpoints, watch variables and many more. Prerequisites:. A clean Windows 7 installation or higher.
At least 1GB free disk space. Internet connection Steps:. Download and install XAMPP.
Test the webserver. Install XDebug. Download and install Joomla. Test Joomla installation.
Download and install Java. Download and configure Eclipse.
Create a new PHP project with Eclipse. Basic Eclipse debugging I could not find good tutorials on the web, so I decided to share my experiences with you, step by step.
The first step is to setup a free XAMPP web server which stands for: X=Cross-Platform, Apache, MariaDB, PHP and Perl. Let's continue and have fun!:-). Next step is to install XDebug which is used by Eclipse. This is a PHP extension which provides debugging and profiling capabilities. The right XDebug version should be downloaded which is created for only one PHP version.
A wizard helps you to generate a download link:. Click the Shell button to open a command prompt and type: # php -i phpversion.txt. Open C: xampp phpversion.txt in a text editor. Select all text and copy it (CTRL+C).
Open to find out which xdebug version. Paste the contents and click the Analyze my phpinfo output button. A download link is generated with the right XDebug version for XAMPP. Download phpxdebug-2.4.1-7.0-vc14.dll. Move the downloaded file to C: xampp php ext. Edit C: xampp php php.ini and add the lines: Xdebug zendextension = C: xampp php ext phpxdebug-2.4.1-7.0-vc14.dll xdebug.remoteenable=1 xdebug.remoteport=9000 Restart Apache:. Click the Apache Stop button.
Click the Apache Start button. Create a new text file in C: xampp htdocs info.php and add the following lines: Now open a web browser at. A new xdebug configuration should be displayed. (See screenshot).
Now you're ready to install Joomla!. Download Joomla! From In my case, it is saved to Downloads/Joomla3.6.2-Stable-FullPackage.zip. Extract the zip file in the C: xampp htdocs directory and overwrite existing files. Open in a web browser to start the Joomla installation. Set Main Configuration:.
Site Name: Joomla. Description Administrator: A description. Email Administrator: [email protected]. Username Administrator: root. Password: secret. Confirm Administrator Password: secret Click Next Set Database Configuration:. Database Type: MySQLi.
Host Name: localhost. Username: root. Password: secret. Database Name: joomla. Table Prefix: jos.
Database Process: Remove Click Next Finalization:. Make sure Pre-Installation Check column is green. Click Install. Is now installed.
Click ' Remove installation folder'. Download Eclipse PDT (PHP Development Tools) from: Download 32 bit or 64 bit version.
Extract the eclipse-php-neon-R-win32-x8664.zip file. Double click on Downloads eclipse eclipse.exe to start Eclipse.
Accept default workspace and click OK. Allow eclipse.exe to the Windows Firewall when a window pops up. Close the Welcome tab (by clicking the X). Click in the toolbar Window Preferences:.
Click PHP Interpreter: This should be set to your PHP version. Click PHP PHP Executables Add:. PHP executable tab: Name: PHP. Executable path: C: xampp php php.exe.
PHP ini file (optional): C: xampp php php.ini. SAPI type: CLI. Click Next:. Debugger: XDebug. Port: 9000.
Click Finish. Click General Web Browser:. Select: Use external web browser. Check: Default system web browser. (Or choose another one). Click OK.
Now we're ready to create and configure a new PHP project and use existing Joomla! Click in the toolbar: File New PHP project:. Project name: joomla.
Check: Create project at existing location (from existing source). Directory: C: xampp htdocs Click Finish.
Click in the toolbar Window Preferences Servers Select Default PHP Web Server click Edit:. Click Server tab:. Server Name: Default PHP Web Server. Base URL:. Document Root: C: xampp htdocs.
Click Debugger tab:. Debugger: XDebug. Port: 9000. Click PathMapping tab click Add:. Path on Server:.
Path in File System: C: xampp htdocs. Click OK Finish OK. Let's continue to debug your fist Joomla! Now you're ready to start debugging.
Expand the joomla project directory. Double click index.php to open it in the editor. Set a breakpoint on line 12 (left of the line number). Click in the toolbar debug button (small down arrow) Debug As PHP Web Application.
Next time you can click the Debug button in the toolbar instead. Set Launch URL to: click OK. You'll be asked to switch to Debug perspective. Answer with Yes. You can switch back to PHP project perspective by clicking the small PHP button in the upper right corner.
Your default web browser such as Firefox will be opened at: You can change this for example to Chrome in the Preferences dialog box General Web Browser. The web browser displays a blank white page, because the breakpoint in Eclipse should be reached on index.php line 12. Now you should be able to step through the code with shortcuts:. F5 Step into. F6 Step over.
F7 Step return (or out). F8 Resume (or continue) Now press 3x F6. The $startTime variable is displayed in the Variables tab. Hover over the variable to see the contents of the variable. Press F8 to resume. The entire website is now displayed in your web browser.
Refresh your web page in the web browser to reload the page. The breakpoint in index.php line 12 is reached again. Notes:. Use the debug button to start a debug session once. Use the terminate button CTRL+F2 to stop the debugger.
Installation Guide Requirements. The PHP/Java Bridge is pure Java JEE application. You need Java 1.4 or above running on any operating system or architecture. A standard JEE server or servlet engine is recommended to run the Java code.
If you don't want to use it, you won't get any support from us. If you prefer a proprietary (non-JEE) application server, please visit.
Do not search for a PHP extension, java.so or phpjava.dll. These extensions are obsolete. Everything needed to communicate with a Java servlet engine is part of PHP 5.
Installation. Test your PHP installation with: java -jar JavaBridge.war If the test fails due to a missing 'php-cgi', expect step no. 3 to fail, too. Download and install (or any other supported servlet engine or application server) as a Windows or Unix service and copy JavaBridge.war to its autodeploy folder. Browse to and run the PHP and JSP examples. If this step fails due to a missing 'php-cgi', run Apache/IIS PHP, see below.
Copy or symlink the created webapps/JavaBridge folder to the web server document root. Browse to and run the PHP examples through Apache/IIS PHP. For further information please see the INSTALL.J2EE file from the documentation download.
Supported servlet engines and application servers The following Java Application Server back-ends are supported:.,.,.,.,.,.,.,.,. Note for Jetty users: This server returns NULL for. In order to allow PHP scripts to access the file system, you need to deploy an exploded application instead. Supported HTTP servers The following HTTP server front-ends are supported:.,.,.
any supported Java Application Server listed above. User contributed guides.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |