Zend Debugger works in combination with many configurations of Apache Web Server and the php programming language under both Linux and Windows. The vast


Download 63.41 Kb.
NameZend Debugger works in combination with many configurations of Apache Web Server and the php programming language under both Linux and Windows. The vast
A typeDocumentation
Zend Debugger works in combination with many configurations of Apache Web Server and the PHP programming language under both Linux and Windows. The vast majority of applications developed using Zend Studio and debugged with Zend Debugger are deployed to Linux-based servers operated by internal I.T. groups or hosted by third party internet service providers (ISP). Often, the PHP developer has little to no control over the configuration of the target server, but would like to mimic that configuration as closely as possibly on the development workstation. Zend strives to allow the developer flexibility in the choice of web server and version of PHP used in conjunction with Zend Studio and the very powerful Zend Debugger.
Although the target system may be a Linux-based system based on the L.A.M.P. (Linux Apache MySql PHP) architecture, many developers choose to work in the Windows environment where a wider choice of commercially supported applications are available than are in Linux. However, there are limitations to the combinations of Apache and PHP versions that may be used in concert with the Zend Debugger under Windows. Specifically, Zend Debugger does not support 64-bit version of Apache or PHP nor does it support Thread-Safe versions of PHP. The NTS (non-thread safe) requirement precludes the use of the most popular WAMP Server which includes a very user friendly installation program and graphical tools to maintain multiple configurations.
This means that the Windows developer who demands the powerful combination of Zend Studio and Zend Debugger is required to do a little extra work with respect to installation of Apache and PHP than is required using an installation program such as that found in an MSI file. This summary is aimed to assist quick installation of Zend Debugger (32-bit) on Apache 2.4 and PHP 5.5/5.6 VC11 builds, which at the time of this writing, are the most recent stable releases available on Windows.
These same instructions can be used to install Apache 2.2 and PHP 5.4/5.5 VC9 builds, just make sure you get the correct versions from the websites below.
1. For VC11 builds to run, you need to install 32-bit Microsoft re-distributable library:

http://www.microsoft.com/en-us/download/details.aspx?id=30679

Check the box next to “VSU_4\vcredist_x86.exe” and press NEXT in order to download the executable. After downloading, execute (run) the program. If you see prompts for “repair”, “uninstall”, and “close”; chose “close” as it means that the program is already installed on your system. Otherwise, accept the license agreement and close after completion.
2. Install Apache (and Fast CGI PHP Wrapper module)
These procedures assume that Apache has NOT been installed on your system. Although it is possible to have multiple versions of Apache installed on your system, these simplified procedures do not address that scenario. If Apache is installed and you want to follow these tested procedures exactly, stop Apache (and any monitor), uninstall the service (httpd.exe –k uninstall), and delete C:\Apache24 if it exists)
Download and Install Apache 2.4 32-bit VC11, and Modules (for Fast CGI PHP Wrapper) from:

http://www.apachelounge.com/download/

Latest version when writing this article:

http://www.apachelounge.com/download/VC11/binaries/httpd-2.4.10-win32-VC11.zip

http://www.apachelounge.com/download/VC11/modules/modules-2.4-win32-VC11.zip
2.A Download the httpd zip file and extract the httpd ZIP to C:\Apache24, which is the default Root directory (Feel free to use a different directory, but be aware that the instructions below assume that are using this default folder). If extracting with WinZip, choose the “All files/folders in archive”, select the “use folder names” option, and choose “C:/” as the “Extract to”. This will place a ReadMe.txt and “-- Win32-2.4.10 VC11 update 4 –” file in the C:\ folder, but places the rest of the files in appropriate subfolders of C:\Apache24.
The Document Root of the default site is in C:/Apache24/htdocs (change if needed in httpd.conf).
2.B. Extract mod-fcgid.so from the modules ZIP to the Apache modules directory (Default C:\Apache24\modules) If extracting with WinZip, choose the “Selected files/folders”, UNselect the “use folder names” option, and choose C:\Apache24\modules as the “Extract to”.


3. Get PHP 32-bit 5.5/5.6 NTS VC11 from http://windows.php.net/download/ NTS stands for Non-Thread Safe and it is important to pick an NTS version and a 32-bit (x86) version.

Latest versions when writing this article (select only one):

http://windows.php.net/downloads/releases/php-5.6.3-nts-Win32-VC11-x86.zip

http://windows.php.net/downloads/releases/php-5.5.19-nts-Win32-VC11-x86.zip
3.a Extract the PHP zip file to C:\PHP (or other folder, but the rest of these instructions assume C:\PHP) . If extracting with WinZip, choose the “All files/folders in archive”, select the “use folder names” option, and choose C:\PHP as the “Extract to”.
3.b Copy “C:\PHP\php.ini-development” (assuming you are installing to a development machine) or php.ini-production to “C:\PHP\php.ini”
4 Configure Apache to run PHP with FastCGI wrapper
Copy C:\Apache24\conf\httpd.conf to C:\Apache24\conf\httpd.conf.bak for backup purposes (assuming Apache24 is your Apache 2.4 install folder)
Edit C:\Apache24\conf\httpd.conf as follows:
4.a Go to the end of all "LoadModule" section, and add new module for PHP:
# FastCGI with PHP

LoadModule fcgid_module modules/mod_fcgid.so

FcgidInitialEnv PHPRC "C:\PHP"

AddHandler fcgid-script .php

FcgidWrapper "C:/PHP/php-cgi.exe" .php
4.b FastCGI module configuration for the document root

Make sure the section (of C:\Apache24\conf\httpd.conf) is modified to allow CGI and to permit .htaccess to override Apache configuration for specific applications. Also, automatically load index.php (or index.html) if no file is specifiedin a URL.
Options Indexes FollowSymLinks ExecCGI
# Allow overrides, such as may appear in any .htaccess in a folder

AllowOverride All

#If a URL contains only a folder, and not a file, look for these files

DirectoryIndex index.php index.html
Save httpd.conf
5. Install Apache as a service
Open a command prompt running with administrator privileges (In Windows 7, START => ALL PROGRAMS => Accessories and then Right-click on “Command Prompt” and select “Run as Administrator”
Navigate to C:\Apache24\bin by entering:

cd C:\Apache24\bin
Install Apache as a service by entering:

httpd.exe –k install
The service should install and the webserver should start. If not errors will be reported. In the example below, an error existed in the http.conf which was reported on the first attempt to install. The service was then uninstalled, the error corrected (the mod_fcgid.so was not where it should have been), and the service restarted without any errors.


You may now close the Command Prompt window.
You may verify that Apache is running by opening a browser and navigating to http://localhost or http://127.0.0.1 whereupon you should see the “It works!” page.

6. Install the Apache Monitor to StartUp folder.

This step is optional. The Apache Monitor is a graphical tool accessible from the task bar that facilitates starting and stopping the apache server. Many people like to have the monitor start up automatically.
Open a couple of Explorer panes (Start and then type “explorer” into the search box, press enter to open an explorer pane)

In one pane, navigate to “C:\Documents and Settings\All Users\Start Menu\Programs\Startup “
In the other pane, navigate to C:\Apache24\bin (using the explorer program or by using Start => Computer ). Right-click on ApacheMonitor.exe and drag that file to the other pane “C:\Documents and Settings\All Users\Start Menu\Programs\Startup” . Release the mouse button and select “Create Shortcut Here”.


If you would like to start the monitor, you may return to the C:\Apache24\bin pane and double-click on ApacheMonitor.exe whereupon you may get a security warning:

Uncheck the “always ask before opening this file” checkbox and press RUN.
You will then see the apache monitor in the task bar (lower right by default). If you don’t see it directly, use the “show hidden icons” in task bar to expose it.
6. Test PHP within Apache

If Apache starts up without errors, go ahead and place a test script in C:\Apache24\htdocs
For example, using a text editor, creat a file in that folder called test.php:



echo "I'm running from PHP ".phpversion();
phpinfo();

?>
Save the file and then Check your browser at http://localhost/test.php whereupon, you should see something similar to :


If you get errors or no output, check the log in C:\Apache24\logs\error.log
7. Get Zend Debugger PHP 5.5/5.6 VC11 package from:

http://www.zend.com/en/products/studio/downloads#Windows

Download “Zend Studio Web Debugger - PHP 5.5 and PHP 5.6 VC11” which is a zip file ZendDebugger-cygwin_nt-vc11.zip
Open the debugger ZIP file and extract the correct ZendDebugger.dll as designated by the folder (version 5.6 for this example) to C:\PHP . If extracting with WinZip, choose the “Selected files/folders”, UNselect the “use folder names” option, and choose C:\PHP as the “Extract to”.
Also extract the dummy.php to the document root, which is by default C:\Apache24\htdocs . If extracting with WinZip, choose the “Selected files/folders”, UNselect the “use folder names” option, and choose C:\Apache24\htdocs as the “Extract to”. As you develop projects located outside the default root folder, you will need to copy the dummy.php to those root folders as well.
Backup and Edit C:\PHP\php.ini, and add to the end of the file:
zend_extension="C:\PHP\ZendDebugger.dll"

zend_debugger.allow_hosts=127.0.0.0/8
Save php.ini and restart Apache (possibly by using the ApacheMonitor in the task bar)
After doing so, visit http://localhost/test.php and note that you should see, in the ZEND ENGINE section that the Zend Debugger is indeed installed.

8. Add the Zend Debug Plugin to your browser
We will use Chrome in this setup example, but plugins are also available for FireFox.
Note that ZEND does not have and official plugin.
Using Google Chrome, visit https://chrome.google.com/webstore/search/zend%20debugger which will display a list of available plugins. Choose the “ExtensionZend Debugger Extension” by Beyerz by clicking on the plus sign in the “free” box whereupon you will be asked to ADD the plugin. Press ADD to install.
9.Configure Zend Studio to use the Local Apache Server
By default, Zend Studio uses Zend Server as the web server when running programs. This server uses the url http://localhost which conflicts the just installed Apache server.



Open Zend Studio (this example uses version 11)

From the menu select Windows => Preferences => PHP =>Servers
Highlight LOCAL ZENDSERVER and select EDIT

Change the base url to something other than http://localhost , for example http://localhost2

Select FINISH
SELECT NEW to add the Apache installation

Local PHP Project => NEXT

Server Name: Localhost

Installation Directory: C:\Apache24

Press FINISH
Highlight localhost and press SET AS DEFAULT

Click OK to close the PHP SERVER window

10. Test the Debugger
Open Zend Studio (this example uses version 11)
From the PHP perspective within ZEND Studio, create a new project which will point to the test.php program made previously in the default document root at C:\Apache24\htdocs
File => New => PHP Project from Existing Directory

    1. Project Name: htdocs

    2. Location: C:\Apache24

    3. PHP Server: Select Localhost

Press FINISH

While leaving Zend Studio open, http://localhost/test.php studio open, open a browser that has the Zend Debug Extension installed

Visit http://localhost/test.php

On the right, you should see the green Zend Debugger Extension icon

Click on the Zend Debugger Extension icon an select NEXT

The Green icon should then have a read “N” on it indicating that the NEXT page loaded will invoke the debugger

Press REFRESH on the browser to cause the page to reload
Now the magic should happen. Control will be passed to Zend Studio.

Test.php should open in the DEBUG perspective

You may now use the commands such as the STEP OVER (F6) and STEP INTO (F5) or RESUME (F8) to debug the program.



Hint: When setting the Debugger on new profile for PHP Web Application, Configure Zend Debugger and manually move the 127.0.0.1 to the beginning of the Client IP list. This will speed up testing and debugging start, instead of going through all the other machine IPs (real, virtual, vpn) before getting to local connection.

Also, your Debugger Test will fail if there is no dummy.php in document root.
BTW - besides adding the new server as Generic PHP server, you can also add the PHP 5.6 executable for running PHP scripts directly from Studio (with ALT+SHIFT+X then H)

Zend Debugger Installation Windows of Rev: 11/27/14

Share in:

Related:

Zend Debugger works in combination with many configurations of Apache Web Server and the php programming language under both Linux and Windows. The vast iconWindows 10, Windows 7, Windows xp, Windows ce, Windows Mobile, Windows...

Zend Debugger works in combination with many configurations of Apache Web Server and the php programming language under both Linux and Windows. The vast iconPhp is probably the most popular scripting language on the web. It...

Zend Debugger works in combination with many configurations of Apache Web Server and the php programming language under both Linux and Windows. The vast iconWindows Authentication with eb web Server

Zend Debugger works in combination with many configurations of Apache Web Server and the php programming language under both Linux and Windows. The vast iconPhp programming Bundle – 5 Video Courses To Master php technology

Zend Debugger works in combination with many configurations of Apache Web Server and the php programming language under both Linux and Windows. The vast iconLinux Programming "Unit-i linux Utilities"

Zend Debugger works in combination with many configurations of Apache Web Server and the php programming language under both Linux and Windows. The vast iconIndependent coursework programming Object-oriented programming in...

Zend Debugger works in combination with many configurations of Apache Web Server and the php programming language under both Linux and Windows. The vast iconNtfs (New Technology File System) is the standard file system of...

Zend Debugger works in combination with many configurations of Apache Web Server and the php programming language under both Linux and Windows. The vast iconThis is the last version than will support windows server 2003/XP....

Zend Debugger works in combination with many configurations of Apache Web Server and the php programming language under both Linux and Windows. The vast iconWhatever testing we were doing manually if we do the same thing with...

Zend Debugger works in combination with many configurations of Apache Web Server and the php programming language under both Linux and Windows. The vast iconWhatever testing we were doing manually if we do the same thing with...




forms and shapes


When copying material provide a link © 2017
contacts
filling-form.info
search