Thursday, January 08, 2009

php installation on leopard PEAR Smarty

I've upgraded to Leopard finally and I've ran into some problems upon running php PEAR and Smarty so i will list them and also their solutions.

1. Apache 2 user web site permission or access issue
This basically was the default configuration issue on leopard & apache 2.
Unlike tiger systems, you have to add username.conf or local.conf to gain access to user account on the web server.
It's is confusing that apple does this. but don't trust those words and ip addresses you see on the web sharing page on SystemPreference app.

and then add those Directory deny etc etc thing you do

after that for php you'll have to edit httpd.conf
just remove sharp from the line on php5 module.

go-pear.php tutorial you see when you search for leopard pear installation works but bit wrong.
It tells you to include usr/share/pear even though the author is installing on some other directory...
well let PEAR installer handle all those directory (because it asks you if you want to change the include_path)
if you've installed PEAR on whatever directory that's the directory you need as the include path. You'll see capital PEAR folder somewhere and inside you'll see HTML, DB and things like that. that's the directory you need to include.

3 Smarty
download file from the website includes all documents. what you need to "cp" are inside the lib folder inside Smarty folder. don't follow direction as is.

4 PHP include_path
It's sometimes better to keep them as global include and when you want to do this would you install it on PEAR directory? you probably wouldn't want to do that. Then what you can do is to set multiple include_path directory.
private/etc/php.ini is the file you want to edit and look for include_path

when you want multiple include_path on mac system you cannot do : and another directory
instead do :: (two colons) between two directories.

for example,

all these you might need root level access to your system.

that's probably enough to remind myself of what to do next time I install so I won't have to waste couple hours struggling with it. hope this helps.

No comments: