I am having a very hard time getting Eclipse working on my MBP running Snow Leopard. I downloaded the Eclipse IDE for Java developers (mac cocoa 64 bit), and extracted all the files.
How to install PEAR, PHPUnit, and XDebug on Mac OS X 10.6 Snow Leopard I use on my Apple Macbook — my primary web development machine. By default, Mac OS X 10.6 includes PHP 5.3.0 and Apache 2.2.11. Unfortunately, a default Mac OS X 10.6 install does not include more advanced tools for testing and debugging PHP applications. This tutorial demonstrates how to install, and on Mac OS X 10.6 Snow Leopard. Turn on PHP After upgrading to Snow Leopard, PHP may be disabled. To activate PHP, you need to load the PHP 5 module in the Apache configuration file.
Open /etc/apache2/httpd.conf file with vi or TextMate. Locate this line (line 115 for me): #LoadModule php5module libexec/apache2/libphp5.so Remove the ”#” from the beginning of the line so that it looks like this: LoadModule php5module libexec/apache2/libphp5.so Save httpd.conf. Now restart the Apache web server. Open System Preferences and click on Sharing.
Uncheck Web Sharing, then re-check Web Sharing. This restarts the Apache web server and loads the newly activated PHP 5 module. To ensure PHP is working, create a new text file in /Sites/ named index.php. This file will have the following contents: When you view in a Web browser, you should see a lot of information about your PHP installation. This means PHP and Apache are now working. If you do not see a lot of information, you need to review the previous steps.
![Eclipse Download For Mac Snow Leopard Eclipse Download For Mac Snow Leopard](http://beginnersbook.com/wp-content/uploads/2016/04/eclipse_download_page-1024x696.png)
At this point, I assume Apache and PHP are working. Install PEAR and PHPUnit, a member of the xUnit family of testing frameworks, provides an easy-to-use framework for testing and analyzing your PHP applications. PHPUnit recommends that you install using. Unfortunately, when I attempted to install PHPUnit using the default PEAR install on Mac OS X 10.6, I was told PEAR was too old and must be upgraded before I could install PHPUnit.
Install PEAR Instead of upgrading Mac OS X's PEAR install, I install my own copy in /usr/local/. Open /Applications/Utilities/Terminal.app and enter this command: $ cd /usr/local Next, we begin the PEAR installation process. Enter this command into the Terminal: $ curl sudo php Enter your administrator password if prompted and answer any questions that follow. You should be okay if you accept the default answers for each question. When the script finishes, PEAR should be installed in /usr/local/bin/. The PEAR library should be accessible at /usr/local/PEAR/.
Update system PATH Now we need to add our custom pear install to our system PATH. Create or edit your bash profile in vi (or TextMate): $ vi /.bashprofile Ensure this file includes the following line of text: PATH=/usr/local/bin:$PATH Save the file and restart the Terminal application for this change to take effect. Next, we should verify that pear works. Run this command in the Terminal: which pear This command should answer ”/usr/local/bin/pear”. Update PHP include path Now we need to tell PHP where our PEAR library is located by adding pear to the PHP include path in the /etc/php.ini file. This file does not exist by default on Mac OS X 10.6. To create this file, run the following command in the Terminal: $ sudo cp /etc/php.ini.default /etc/php.ini Next, we need to edit /etc/php.ini file in vi or TextMate and update the PHP include path.
Locate the following line in /etc/php.ini:;includepath = ”/php/includes” Remove the ”;” from the beginning of the line and add the PEAR library path. Includepath = ”/usr/local/PEAR:/php/includes” Save /etc/php.ini.
Restart the Apache web server by unchecking and rechecking System Preferences Sharing Web Sharing. Next, view in a web browser (you created this file earlier).
Search for “includepath” and verify the path now includes ”/usr/local/PEAR”. PEAR is now installed. Install PHPUnit Next, we install PHPUnit.
This is the easy part. Run this command in the Terminal: $ sudo pear channel-discover pear.phpunit.de Next, run this command in the Terminal: $ sudo pear install phpunit/PHPUnit That’s it. PHPUnit is installed and located at /usr/local/PEAR/PHPUnit/. You can now include PHPUnit in your PHP scripts with this line: requireonce 'PHPUnit/Framework.php'; Install XDebug is an advanced debugging and profiling tool for PHP. It provides stack and function traces, memory allocation, profiling, code coverage analysis, and more. Instead of compiling XDebug from source, I will use a pre-compiled PHP extension from ActiveState.
Go to this url in a Web browser: Download the PHP Remote Debugging file for Mac OS X. Unarchive the downloaded file, and you should see a new folder like this: Enter the “5.3” directory and find the file named “xdebug.so”. You need to move this file to the /usr/lib/php/extensions/no-debug-non-zts-20090626 directory. First, open a new Finder window and press Cmd + Shift + G.
Enter /usr/lib/php/extensions/no-debug-non-zts-20090626/ into the prompt that appears and press “Go”. This will open the destination directory in the Finder window. Drag xdebug.so into the destination directory. You may be prompted for your administrator password. If the /usr/lib/php/extensions/no-debug-non-zts-20090626/ directory does not exist, locate the /usr/lib/php/extensions/ directory instead. This directory will contain a directory named something similar to no-debug-non-zts-20090626.
Place xdebug.so into that directory instead. Finally, we need to tell PHP to use the xdebug.so extension. Edit /etc/php.ini in vi or Textmate.
Append the following lines to the bottom of the file: xdebug zendextension=/usr/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so Ensure the path to xdebug.so is correct. Save the file and restart the Apache web server by unchecking and rechecking System Preferences Sharing Web Sharing. View in a web browser.
Search for “Xdebug”. If you find the xDebug section, XDebug is installed. Conclusion You now have an advanced PHP installation running on Mac OS X 10.6 Snow Leopard with PHP 5.3.0, PEAR, PHPUnit, and XDebug. Post any questions or comments below. Bob How did you track down the URL at ActiveState with the prebuilt Xdebug? I found a page on their main site that has remote debugger downloads but the version listed there only includes up to the 5.2 folder - it does not have the 5.3 folder thats needed for Snow Leopard. I then found my way into the ASPN area, but I do not see how to get to the ASPN-dedicated download page that you linked to; even a search on their site for the page title turned up nothing.
I would like to know how to navigate back to it in the future if needed. Matt Hi Josh, I followed your instruction, and tried many variations found around the web as well, but nothing seems to work in loading xdebug with my php installation. I have no errors anywhere, it just doesn't appear in my phpinfo. No matter what I try, I always get nothing: P3: pilot$ php -m PHP Modules ctype curl date dom exif filter ftp hash iconv json ldap libxml mbstring mysql mysqli odbc openssl pcre PDO pdosqlite posix Reflection session SimpleXML sockets SPL SQLite standard tokenizer xml xmlreader xmlrpc xmlwriter xsl zlib Zend Modules I'm on 10.5 Leopard, but I doubt it changes much from yours, except I'm still on PHP 5.2 if you have any leads, that'd be appreciated;). Kematzy Hi Josh & everyone, Thanks for your tutorial.
Sad to say it did not work for me straightaway on a fresh install of Mac OS X 10.6 (Snow Leopard) on a MacBook Air. However, when I added these steps it works just fine: $ sudo pear upgrade-all $ sudo pear channel-discover pear.phpunit.de # PHPUnit depends upon parts from these repositories $ sudo pear channel-discover pear.symfony-project.com $ sudo pear channel-discover components.ez.no # Once those are discovered, you can install PHPUnit and it works. $ sudo pear install phpunit/PHPUnit Thanks for your time. Cris Thanks for the great tutorial. I am on OS X Lion (10.7) and i am getting this while building the project. Tried all sorts of options for setting up the path in php.ini.
![Download Download](/uploads/1/2/5/5/125564536/754662287.png)
Any help will be greatly appreciated! Warning: requireonce(phing/Project.php): failed to open stream: No such file or directory in /usr/share/pear/phing/Phing.php on line 22 Fatal error: requireonce: Failed opening required 'phing/Project.php' (includepath='/usr/share/pear/./classes.:') in /usr/share/pear/phing/Phing.php on line 22.