How to install Zend Server CE & PEAR & PHPUnit

June 21st, 2011 by Paul Leave a reply »

The steps below should allow you to install Zend Server CE & PEAR & PHPUnit so you have a stable development environment on your local PC. This installation has been tested on an Intel Core 2 Duo machine running Win 7 and an AMD Athlon X2 Dual machine running Vista. We installed everything in the “D:\WebServers\Zend\” folder.

Important: We had a lot of headaches putting these steps together. You might have problems that are not even present in this tutorial. We appreciate it if you send us any improvements or additional steps which ensure a smoother installation.

Step 1: Clean Up

Before we start:

a) Back up all your local projects & databases

b) Disable your antivirus & firewall

 

1.1. Uninstall your current local web server.

If you already have Zend Server CE installed you can remove it like this:
a) Go to Start->Programs->Zend Server and from there run the Uninstall option
b) Go to Control Panel -> Remove Programs find the MySQL Server 5.1 program and uninstall it
c) Delete the ZendServer folder with all its contents (or move it to another location on your hard disk, as a backup)

 

1.2. Go to Control Panel-> Administrative Tools-> Services and make sure there are no %apache% or %mysql% named services in the list. If there are please do your best to remove them.

1.3. RESTART your PC

1.4. Right click on MyComputer(right-click)->Properties->Advanced System Settings->Environment Variables and make sure that the “Path” environment variable contains no references to your previous web server. If it does remove them and RESTART your PC.

Step 2: Install Zend Server CE

2.1. If you are using Skype be careful, it uses ports 80 and 443 as well. You should disable that option in Skype http://www.mydigitallife.info/disable-skype-from-using-opening-and-listening-on-port-80-and-443-on-local-computer/

2.2. Download Zend Server from http://www.zend.com/en/products/server-ce/ and run the installer

2.3. Select “Custom Install” and check all options except the ones that are unchecked in the attached screen shot

2.4. Complete the steps available at http://localhost:10081/ZendServer/

2.5. After the installation is complete, go to D:\WebServers\Zend\ZendServer\etc\php.ini and set:
display_errors = On
display_startup_errors = On

Step 3: Install PEAR

3.1. Open this page in any browser http://pear.php.net/go-pear and save it as a PHP file in D:\WebServers\Zend\Apache2\htdocs\go-pear.php

3.2. Open a browser and go to http://localhost/go-pear.php

3.3. When installing PEAR make sure you set:

“1. Installation prefix ($prefix)” = “D:\WebServers\Zend\ZendServer\bin\”

3.4. Add the PEAR installation path (D:\WebServers\Zend\ZendServer\bin\PEAR) to your “Path” environment variable located in MyComputer(right-click)->Properties->Advanced System Settings->Environment Variables

3.5. Go to D:\WebServers\Zend\ZendServer\etc\php.ini and add the PEAR path to your include path

[Zend]
include_path=”.;D:\WebServers\Zend\ZendServer\share\ZendFramework\library;D:\WebServers\Zend\zendserver\bin\PEAR

3.6. RESTART your PC

Step 4: Install PHPUnit

Before you start delete everything from C:\Users\YOUR_USER_NAME\AppData\Local\Temp\

4.1. Open a cmd window. You might need to Run As Administrator

4.2. Run each of the following commands SEPARATELY (and each only once!):

pear channel-discover pear.phpunit.de
pear channel-discover components.ez.no
pear channel-discover pear.symfony-project.com

 

4.3. Now run:

pear install phpunit/PHPUnit

 

 

Thanks for getting so far. We really look forward to your comments. Good luck with the installation process! :)

Attached Files:

Share

29 comments

  1. Shehzad says:

    Great tutorial. It really help me to install PEAR and PHPUnit.
    Thanks

  2. Henrique Fleury says:

    An Exception Has Occurred

    Unknown location: /pear/pear-core/branches/PEAR_1_4/PEAR.php

    HTTP Response Status

    404 Not Found

  3. Cosmin says:

    Can you give me more details about the error?

  4. Henrique Fleury says:

    Sorry my English.
    This error happened when I sent install PEAR and stop at 15%
    I do not know if I am wrong but when I ran this file on localhost it is installing PEAR 1.1.6?
    This error was the top there that I returned.

  5. Henrique Fleury says:

    From what I notice this error with a missing file in the server’s own PEAR

  6. Henrique Fleury says:

    Starting installation …
    Loading zlib: ok

    Bootstrapping Installer……………….
    Bootstrapping PEAR.php…………(remote) “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>

    An Exception Has Occurred

    Unknown location: /pear/pear-core/branches/PEAR_1_4/PEAR.php

    HTTP Response Status

    404 Not Found

    ok
    Bootstrapping Archive/Tar.php…………(remote)

  7. Paul says:

    Perhaps you could inform the PEAR website administrator. I don’t think this error is related to the actual installation process, but most likely to some files that are missing on their server.

  8. Henrique Fleury says:

    I did exactly like this in the tutorial, and by what he says is missing
    / pear/pear-core/branches/PEAR_1_4/PEAR.php
    Nor is there the path and file in my folder of Zend.

  9. Henrique Fleury says:

    This error and my or PEAR?

  10. Paul says:

    Henrique, what you are getting there is:

    HTTP Response Status
    404 Not Found

    Which means that the install script of PEAR cannot download some files. Perhaps the PEAR server is having a problem at the moment. Can you try again later?

  11. Henrique Fleury says:

    Yes, of course
    ir pelo arquivo go-pear.bat que esta dentro da pasta do Zend/ZendServer/bin não é tão recomendado como essa passada?

  12. Henrique Fleury says:

    Yes, of course
    go by go-pear.bat file that is inside the folder Zend / ZendServer / bin is not as recommended as this last?

  13. Paul says:

    I can’t remember exactly but I think I had problems when trying to use the go-pear.bat file that’s why I suggested using the go-pear.php approach. You can try with go-pear.bat and see what happens.

  14. Henrique Fleury says:

    Paul has PEAR installed on my machine several times and always have a problem when writing the command BUILD PEAR which is:
    Unable to open package.xml

    You know what that is or can this be?

  15. Paul says:

    No, I’m not sure what that is. You can try to “delete everything from C:\Users\YOUR_USER_NAME\AppData\Local\Temp\” or uninstall everything and start over again. I also did a lot of install/uninstall until I managed to put together this article.

  16. Henrique Fleury says:

    Paul just to warn:
    I installed the PEAR-pear.bat and just go for testing by the installation did go to run-pear.php. Go figure huh.

  17. pmdci says:

    I had the EXACT same error as Henrique. I did step by step.

  18. Paul says:

    Hi. Did you also look at the last message Henrique posted? It seems he was able to figure out the problem he had.

  19. Paul says:

    thanks a lot for the link :)

  20. Robinson says:

    Bendiciones.

    Me sale este error al tratar de installing PEAR :
    Error

    Warning: fsockopen() [function.fsockopen]: unable to connect to ssl://raw.github.com:443 (Se produjo un error durante el intento de conexi�n ya que la parte conectada no respondi� adecuadamente tras un periodo de tiempo, o bien se produjo un error en la conexi�n establecida ya que el host conectado no ha podido responder.
    ) in C:\Zend\Apache2\htdocs\go-pear.php on line 1075

    download of https://raw.github.com/pear/pear-core/master/PEAR5.php failed: Se produjo un error durante el intento de conexi�n ya que la parte conectada no respondi� adecuadamente tras un periodo de tiempo, o bien se produjo un error en la conexi�n establecida ya que el host conectado no ha podido responder.
    (10060)

  21. Paul says:

    Sorry but I can’t help with this. Perhaps you should get in touch with the guys from PEAR and see why their GIT account is failing.

  22. Luis says:

    Perfect tutorial.
    I followed every step, and it worked perfectly for me.

  23. Paul says:

    I’m glad you found it useful

  24. Christopher says:

    Does not work anymore with zs6

  25. Paul says:

    Thanks for the heads up. If I get the time I’ll post an update. Cheers!

  26. Thanks brother. Worked like a charm.

  27. Paul says:

    I’m glad you found it useful :)

  28. Shyju says:

    Thanks a lot…. It worked for me….

Leave a Reply