Hello,
I am somewhat of a mac noob but am learning.
I am running OSX 10.5.8 on a G5
I am trying to get PHP to run through the standard mac/apache web server.
I can bring up the default index.html page from http://localhost/~myusername/
but when I try to run a .php file from this location I get:
Safari cant open the page http://localhost/~myusername because Safari cant connect to the server localhost.
I have followed some instructions online (http://www.devarticles.com/c/a/Apache/Using-Apache-and-PHP-on-Mac-OS-X/) and have so far managed the following:
In this location: /private/etc/Apache2/users
I have two files httpd.conf and myusername.conf
the latter of which contains the following:
<Directory "/Users/myusername/Sites/">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
I edited the file: httpd.conf
Un-commented these lines
LoadModule php4_module libexec/httpd/libphp4.so
AddModule mod_php4.c
These lines were already un-commented
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
As per instructions online (http://foundationphp.com/tutorials/php_leopard.php), in this location: /private/etc I copied 'php.ini.default' to 'php.ini'
then I edited the php.ini file and changed: error_reporting = E_ALL & ~E_NOTICE to this: error_reporting = E_ALL
I think I've recalled everything I have done here. Obviously I have restarted the Web Service however, on all the examples I have seen this service is called 'Personal Web Sharing' and in my service list I only have 'Web Sharing'. Don't know if that makes any difference.
I'd really like to get this working as I am trying to develop a couple of sites and am fed up of ftp'ing every change to the server just to test it.
If anyone can help me sort this I would appreciate it very much.
Kindest Regards,
Matt.
I am somewhat of a mac noob but am learning.
I am running OSX 10.5.8 on a G5
I am trying to get PHP to run through the standard mac/apache web server.
I can bring up the default index.html page from http://localhost/~myusername/
but when I try to run a .php file from this location I get:
Safari cant open the page http://localhost/~myusername because Safari cant connect to the server localhost.
I have followed some instructions online (http://www.devarticles.com/c/a/Apache/Using-Apache-and-PHP-on-Mac-OS-X/) and have so far managed the following:
In this location: /private/etc/Apache2/users
I have two files httpd.conf and myusername.conf
the latter of which contains the following:
<Directory "/Users/myusername/Sites/">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
I edited the file: httpd.conf
Un-commented these lines
LoadModule php4_module libexec/httpd/libphp4.so
AddModule mod_php4.c
These lines were already un-commented
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
As per instructions online (http://foundationphp.com/tutorials/php_leopard.php), in this location: /private/etc I copied 'php.ini.default' to 'php.ini'
then I edited the php.ini file and changed: error_reporting = E_ALL & ~E_NOTICE to this: error_reporting = E_ALL
I think I've recalled everything I have done here. Obviously I have restarted the Web Service however, on all the examples I have seen this service is called 'Personal Web Sharing' and in my service list I only have 'Web Sharing'. Don't know if that makes any difference.
I'd really like to get this working as I am trying to develop a couple of sites and am fed up of ftp'ing every change to the server just to test it.
If anyone can help me sort this I would appreciate it very much.
Kindest Regards,
Matt.