Click to See Complete Forum and Search --> : MAMP - PHP not working


jtnatoli
08-07-2008, 12:21 PM
I installed MAMP Pro and when I fire it up my php scripts don't work. I was able to set up MySQL databases with phpmyadmin, though. The files are all withing the htdocs folder, no subdirectories. Standard. I checked the PHP logs and had a memory error, so I changed the memory limit in the php.ini and don't get that error anymore, but the scripts still don't work. Any ideas?

NogDog
08-07-2008, 12:44 PM
Are you launching the script via the browser's address bar as a localhost URL rather than clicking the file icon or launching via the browsers File->Open menu?

If that's not the problem, have you tried something really simple, such as:

<?php
phpinfo();
?>

If that works but you're not seeing anything for a "real" script, check your php.ini configuration and ensure that "display_errors" is turned on, and the "error_reporting" is set to something like E_ALL. (Don't forget to restart Apache after you make the change.)

Phill Pafford
08-07-2008, 12:45 PM
is Apache running?

can you test localhost in you web browser URL?

jtnatoli
08-07-2008, 12:51 PM
I created a phpinfo file and it comes out blank. I've been opening files by selecting the file in finder and opening with firefox. typing "localhost" into the address bar returns the "Test Page for Apache Installation" page, which I guess is good?

Phill Pafford
08-07-2008, 12:55 PM
in the MAMP install there should be a sub directory, something like

/mamp/htdocs

This is the php root dir, try placing the info.php script in there

jtnatoli
08-07-2008, 12:57 PM
That's where I placed it originally.

jtnatoli
08-07-2008, 01:03 PM
Really liking reliablesource.org btw.

Phill Pafford
08-07-2008, 01:09 PM
what Mac do you own, Power PC or Intel?

Did you download the right MAMP install?

jtnatoli
08-07-2008, 01:12 PM
Got it figured out! Turns out that I was just accessing the file incorrectly. You led me down the right track by suggesting checking the localhost (localhost:8888), but I just needed to also type in the port number. Once I did that, the scripts were working. Thanks guys!