Getting Entropy PHP to play nice in os x 10.5 Leopard
Tuesday, February 26th, 2008Recently I installed OS X 10.5 Leopard. I wanted to remove the packaged install of PHP and use the Entropy install from Marc Liyanage instead.
Unfortunately I ran in to an error during install:
Install Failed
The following install step failed: run postflight script for Entropy PHP. Contact the software manufacturer for assistance.
After failing to get a solution on google, I decided to fix this myself.
I’m running Apache 2 and it turns out that is where the problem is coming from. Now that I have fixed the issue, I am running a perfectly good Entropy package PHP install, and you can too by following these steps.
Edit: After posting this article, two commenters (see below) suggested a much simpler fix. Simply run the following command:
sudo ln -s /etc/apache2 /etc/httpd
My article goes in to editing files which is really unnecessary if you don’t care about having a symlink pointing to your apache2 directory (and I don’t see why you would care). However if you want to go the more complicated route, I have left my original instructions in tact below.
steps to follow
The very first thing you need to do is enable PHP in the httpd.conf file.
Figure out where this file is located.
Check /etc/apache2/httpd.conf.
If that fails, open Terminal and search for the file by typing:
locate httpd.conf
If that fails, you’ve got bigger problems and should stop now and do some google research.
Once you do locate the file, edit it and uncomment the following line (remove the pound sign from the begining of the line):
#LoadModule php5_module libexec/apache2/libphp5.so
- Download the Entropy package for OS X 10.5 and follow all installation instructions.
- After running through the installation steps, if you do not get the afore mentioned error, you should be good to go. However if you do receive the postflight error, read on.
- Open up Terminal
- Type the following command
cd /usr/local/php5/bin
- Edit the activate-entropy-php.py file using sudo and your favorite text editor (you’ll have to enter your system’s password here):
sudo vi activate-entropy-php.py
- Lines 16 and 18 contain the following code:
httpd_conf_symlink = '/etc/httpd/users/+entropy-php.conf'
- Change httpd to apache2 so that the lines look like this:
httpd_conf_symlink = '/etc/apache2/users/+entropy-php.conf'
- Save and quit editing:
:wq
- Run the Python script, you should not get any errors after it finishes running:
sudo python activate-entropy-php.py
- Restart your server. You can do this by opening System Preferences > Sharing > Uncheck Web Services if it’s checked, then check the box again (or check it for the first time… you get the drift).
Now you just need to create a file in your Sites directory and test the PHP.
Change to your sites directory and create a test file:
cd ~/Sites vi test.php
Add the following PHP to the file:
<php echo phpinfo(); >
Save the file:
:wq
Now open up a browser and type in this address:http://localhost/~[YOUR_NAME_HERE]/test.php
If you see information about your PHP installation, you are good to go. If not, you’re screwed and should consider going to the Entropy forums for further assistance.