Multiple Installs


Running into a siutation with MAC OS 10.2.8, I have to reinstall php, every few days. Before a session I use the php info script, and many times get an unable to connect to local host message. Reinstall the wonderful package from this site, I’m good to go for a few days.

Any suggestions why multiple installs are required?

Open a terminal and type:
$ top
See if httpd is running.
press ‘Q’ (no quotes) to exit.

Also you can type:
$ ps -aux | grep httpd

and see if httpd is running. ‘Cannot connect to localhost’ sounds like a webserver issue and not php. If there was a problem with php you would just see a blank page.

If httpd is not running. Type: $ apachectl -t to see if you have any config errors, then $ apachectl start to restart the httpd server.

the following is from terminal:

Last login: Mon Jul 26 18:07:14 on console
Welcome to Darwin!
[ip68-111-160-232:~] chris% $ top
$: Command not found.
[ip68-111-160-232:~] chris% $ ps-aux | grep httpd
$: Command not found.
[ip68-111-160-232:~] chris%
what gremlin has possed my computer?

$ which top

(and note, don’t include the $ sign, it’s just to show its a terminal)

You might need to include the full path if your environment doesn’t have proper path settings. I am not sure how Mac OSx handles users. System types of binaries should be in: /usr/bin/, /usr/local/sbin/

installed ones would be in: /usr/local/bin/, /usr/local/sbin/

so top would be:
$ /usr/bin/top

I use FreeBSD at home, so your system “innerds” should be similar in layout…

Can you su to root?

$ su

You might be restricted on what you can run as a user. Users usually have to be added to the “wheel” group in /etc/group

So if you see a line like this:

You can add your name where username is and save (must be root to save)

From Terminal:
Last login: Fri Jul 30 09:43:05 on ttyp1
Welcome to Darwin!
[ip68-111-160-232:~] chris% which top
[ip68-111-160-232:~] chris%

So far so good, what’s next?

run top:
$ /usr/bin/top

and check to see if httpd is running (apache web server). If you get that cannot connect to locahost error again, run top and see if httpd is up. If not, then for some reason it didn’t start.
$ apachectl start
is the command you would use to start apache.

From Terminal:
Last login: Fri Jul 30 11:38:04 on ttyp1
Welcome to Darwin!
[ip68-111-160-232:~] chris% apachectl start
Processing config directory: /private/etc/httpd/users
Processing config file: /private/etc/httpd/users/chris.conf
[Fri Jul 30 11:40:18 2004] [warn] module mod_php4.c is already added, skipping
fopen: Permission denied
httpd: could not open error log file /private/var/log/httpd/error_log.
/usr/sbin/apachectl start: httpd could not be started
[ip68-111-160-232:~] chris%