Installing PHP with GD library working on mac OSX 10.5 (leopard)
Par robby le samedi 3 mai 2008, 16:20 - Informatique - Lien permanent
For some web developments and many open-source applications, the Apple default installation of PHP is not convenient : the GD library is missing !
After some web researches (thanks google), i successfully installed PHP with GD.
I am starting from an installation with apache and PHP working: to get this point, read this
Here are the things i did :
- If you have already enabled PHP, disable it in apache config: open the file /etc/apache2/httpd.conf, put a comment before "LoadModule php5_module libexec/apache2/libphp5.so":
#LoadModule php5_module local/php5/libphp5.so
- Get the PHP 5.2.5 Release 6 BETA (You can eventually get the future new versions in Marc's forum):
curl -O http://www2.entropy.ch/download/php5-5.2.5-6-beta.tar.gz tar -xzf php5-*-beta.tar.gz
- If you have already installed the classic Marc Lyanage package, move it to your desktop:
sudo mv /usr/local/php5 ~/Desktop/php5.old
- Put in the new package in place:
sudo mv php5 /usr/local/
- Add a link to tell apache to use this version:
sudo ln -sf /usr/local/php5/entropy-php.conf /etc/apache2/other/+entropy-php.conf
- Configure is the file php.ini. You will find the file inside the new package. Edit /usr/local/php5/lib/php.ini. To contact the database MySQL with PHP you have to set the default socket name for local MySQL connects. Find the line starting with "
mysql.default_socket =
", modify it to : "mysql.default_socket = /var/mysql/mysql.sock
", save the file. - Restart apache:
sudo apachectl restart
- PHP should now be up and running. You can test it by dropping a file named test.php into your apache root folder directory (/Library/Webserver/Documents/). Into that file, write this line:
<?php phpinfo() ?>
. Now open up http://localhost/test.php in your web browser. You should see a status table with information about the PHP module.
In case you just want the classic Marc Lyanage PHP version with no GD, do this:
- make a link to help installation process :
sudo ln -s /etc/apache2 /etc/httpd
(if not you will get an error like "The following install step failed: run postflight script for Entropy PHP. Contact the software manufacturer for assistance") - get entropy PHP package at http://www.entropy.ch/software/macosx/php/
- Install the entropy package (double-click on "entropy-php.mpkg")
References :
Commentaires
Thank u... works great on Drupal OSX !
thank very much it.'s work
Fast and easy, thanks!
How to enable or install support for X Window http://wiwapia.com/en/windows to use that server also for doing some work in X. ??
Try this:
http://www.entropy.ch/software/maco...
works perfect for me
I followed your instructions exactly, but PHP doesn't seem to be running. What could be wrong? Apache is running fine.