Re: Installing PHP on MacOS X

From: max power (maxpower_at_invalid.com)
Date: 10/08/04


Date: Fri, 08 Oct 2004 18:33:26 +0100

In article <BD8C7F01.2B70%hmbg@telia.com>, Hans M <hmbg@telia.com>
wrote:

> MacOS X 10.3.5
>
> I have installed
>
> http://www.entropy.ch/software/macosx/php/
>
> on my PowerBook G4.
>
> Being a newbie I don't get the test.php file to "work".
>
> Can anyone here assist me in advising a good way
> to *check* the installation is valid?
>
> The "/etc/httpd/httpd.conf" file does contain
>
> AddType application/x-httpd-php .php
> AddType application/x-httpd-php-source .php
>
> sigh...
>
> How do I do now?
> Are you a Mac user?
>
> Thank you in advance.
>
> /Hans.
>

I've installed php a few times on OSX Macs, and have also used the
Entropy installers as you have. I've had very few problems with this,
and have never found any need to edit or change the Apache config file
(httpd.conf) or any of the php config files after installation - in
fact I've left those well alone.

Here are a few things that may help you get everything running
correctly. (You said you were a newbie at this, so excuse me if some of
this may be stating the obvious).

1) php runs under the Apache web server, so you need to have Apache
running before php will work. Apache (1.3.x) is already installed as
part of OSX, but it is switched off by default for security reasons. To
start Apache, open System Preferences/Sharing and enable Personal Web
Sharing. You can also start Apache via the Terminal, but this is the
easiest way, and when enabled, will automatically start up Apache when
you restart your Mac.
Note: for some reason, IE in OSX does not support 'localhost' URLs, but
will work with 127.0.0.1 - any other OSX browser supports either.

2) The default root web directory on OSX is
/Library/WebServer/Documents, which can be accessed in your browser on
your own Mac by the URL http://localhost/ or http://127.0.0.1/
This URL on it's own will display the default Apache home page, or any
other page you may have replaced that with, and will confirm that
Apache is running ok (irrespective of php).

3) Each OSX User also has their own 'Sites' folder inside their 'home'
folder - this is your own web site(s) folder, as opposed to the system
one described above. This can be accessed in your browser by the URL
http://localhost/~shortusername/ or http://127.0.0.1/~shortusername/
Unless you've changed it, this URL will display the default OSX home
page.

4) The test.php file referred to in the Entropy installation
instructions on their web site MUST be saved/placed in either the
system root web directory (/Library/WebServer/Documents) or your user
Sites folder. When that's done, you can run this php file in your
browser via the URL http://localhost/test.php or
http://localhost/~shortusername/test.php depending where you
saved/placed the test.php file. If that works, then your Apache/php
installation is working correctly and you will see a page of info about
your php & Apache setup.
Note: if you edit/create your test.php file using TextEdit, make sure
you save it in plain text format via the Format menu (not the default
.rtf format).

HTH,
max



Relevant Pages

  • Re: Apache2 & php5 Problem
    ... The file contains a test message between header tags and below ... message from the php script line. ... This gives you all the information about your PHP installation. ... You might need to add an AddHandler directive to your Apache config file if there isn't one already and a ScriptAlias ...
    (Debian-User)
  • Re: Need help configuring php 4.3.10 with Apache 2.0.53
    ... Due to the difficulties with SuSE's setup of Apache, I was unable to get SSL to work with the distro's installation of Apache so uninstalled, reinstalling 2.0.53 from Apache's site. ... I restarted Apache over and over without php working. ...
    (alt.php)
  • Problem with mail() function and exec
    ... I hava an apache 1.3.28 + php 4.3.3 installation into ... Into the jail I have installed postfix (with ... If I run apache from outside the jail, the scripts runs perfectly and send the ...
    (php.general)
  • Re: apache and php horor part 2
    ... > Tried installation with apache 2.0.47. ... > and .ini file to the right locations. ... If you have PHP installed as a module, why are you passing PHP pages to ... Apache treat index.html as a PHP program. ...
    (comp.lang.php)
  • PHP Advisory #2
    ... When a web administrator installs Apache with PHP and adds ... about the directory structure of the Apache and PHP installation. ... Details:Sending an OPTIONS request to the web server reveals the ...
    (Bugtraq)