re: HELP! PHP not working

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
Floody
Forum Newbie
Posts: 1
Joined: Tue Dec 09, 2008 6:01 am

re: HELP! PHP not working

Post by Floody »

I am very very new! So sorry... but I can't get PHP code to be seen by my browser when I'm running it off my local web server, my own computer. I've gone through several tutorials and in the terminal app have uncommented the right lines in my httpd.conf file...

so...

Code: Select all

#LoadModule php4_module libexec/httpd/libphp4.so
reads:

Code: Select all

LoadModule php4_module libexec/httpd/libphp4.so
and...

Code: Select all

#AddModule mod_php4.c
reads...

Code: Select all

AddModule mod_php4.c
this was already there:

Code: Select all

<IfModule mod_php4.c>
    # If php is turned on, we repsect .php and .phps files.
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps
 
    # Since most users will want index.php to work we
    # also automatically enable index.php
    <IfModule mod_dir.c>
        DirectoryIndex index.html index.php
    </IfModule>
but under someone's advice I bunged in:

Code: Select all

AddType application/x-httpd-php .php
at the very end of the file. Either way it makes no difference.


I have downloaded the lastest MAMP. I am running Mac OS X 10.4.11. When I ask terminal what version of PHP I have it says "PHP 4.4.7".

I've also tried putting my PHP files in the htdocs files folder recommended by MAMP. When I upload the PHP files to my remote server they read fine.

Please help... I so want to start learning PHP!! Either that or I'm going to chuck myself out the window.

Any help much appreicated.
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: re: HELP! PHP not working

Post by Eran »

LoadModule php4_module libexec/httpd/libphp4.so
Uncommenting is not enough, are you sure this is the correct path to the file? did you check if the file exists at this location?
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Re: re: HELP! PHP not working

Post by nickvd »

Floody wrote:I am very very new! So sorry... but I can't get PHP code to be seen by my browser when I'm running it off my local web server, my own computer. I've gone through several tutorials and in the terminal app have uncommented the right lines in my httpd.conf file...

so...

Code: Select all

#LoadModule php4_module libexec/httpd/libphp4.so
reads:

Code: Select all

LoadModule php4_module libexec/httpd/libphp4.so
and...

Code: Select all

#AddModule mod_php4.c
reads...

Code: Select all

AddModule mod_php4.c
this was already there:

Code: Select all

<IfModule mod_php4.c>
    # If php is turned on, we repsect .php and .phps files.
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps
 
    # Since most users will want index.php to work we
    # also automatically enable index.php
    <IfModule mod_dir.c>
        DirectoryIndex index.html index.php
    </IfModule>
but under someone's advice I bunged in:

Code: Select all

AddType application/x-httpd-php .php
at the very end of the file. Either way it makes no difference.


I have downloaded the lastest MAMP. I am running Mac OS X 10.4.11. When I ask terminal what version of PHP I have it says "PHP 4.4.7".

I've also tried putting my PHP files in the htdocs files folder recommended by MAMP. When I upload the PHP files to my remote server they read fine.

Please help... I so want to start learning PHP!! Either that or I'm going to chuck myself out the window.

Any help much appreicated.

When I installed MAMP, I was very surprised to find that it worked out of the box... Install run mamp.app and click start servers. They also include a dashboard widget which will let you turn the server(s) on/off from the dashboard.
Post Reply