February 16, 201214 yr I downloaded MAMP the other day, which means Apache, MySQL and PHP for Mac. I read that macs have php support installed by default and an apache server built in, so I wonder if I could've just downloaded MySQL...Anyways, there is this folder called MAMP/htdocs/ where I'm supposed to put my .php files, and then they'd be visible from http://localhost:8888, but so far none of my copy-pasted php hello world's haven't worked. I'm pretty sure my code is flawless, as it's straight from tutorials. Also I managed to run the code using mac's command line, aka terminal, with the command "php helloWorld.php". Been trying to figure out if the problem is with MAMP; did I install it wrong or is there something wrong with the apache server or what. I was hoping this to be more like the "install and you're ready" kind of package they promised it would be. But if there are any php gurus out there, any words of courage would be appreciated.
February 16, 201214 yr Does the server work properly with plain html files? Do you have a phpinfo file that you've tried to run? "It's not a rest for me, it's a rest for the weights." - Dom Mazzetti
February 17, 201214 yr Author Plain html works fine Running phpinfo();, I got hundreds of rows of information. Most peculiar lines were Configuration File (php.ini) Path => /etcLoaded Configuration File => (none) but most of the stuff seemed to be enabled and working.Oh, and phpinfo didn't work with browser, I did it with terminal to get the results.
February 17, 201214 yr Are you using MAMP Pro? "It's not a rest for me, it's a rest for the weights." - Dom Mazzetti
February 17, 201214 yr Hmm. No idea then. You could try the MAMP forums (http://forum.mamp.info/index.php?c=1); they'll probably be better suited to help you. "It's not a rest for me, it's a rest for the weights." - Dom Mazzetti
June 11, 201214 yr Hmm. This might help. Make a new file in TextWrangler or Komodo, or whatever, and add the folllowing code: AddType application/x-httpd-php .html .htm AddHandler application/x-httpd-php .html .htm You're going to save the file as .htaccess (with the dot in the front; this is the file name). Save it in /Applications/MAMP/htdocs. It will be an invisible file; you will not see it in Finder, tho you can if you cd to it w/ terminal, or searching w/in Finder and choosing the visibility type under Kind. Now try going to http://localhost:8888/ and you should see all of the available files there. And with this newly created .htaccess file, you can now embed php inside an html file too. I downloaded MAMP the other day, which means Apache, MySQL and PHP for Mac. I read that macs have php support installed by default and an apache server built in, so I wonder if I could've just downloaded MySQL...Anyways, there is this folder called MAMP/htdocs/ where I'm supposed to put my .php files, and then they'd be visible from http://localhost:8888, but so far none of my copy-pasted php hello world's haven't worked. I'm pretty sure my code is flawless, as it's straight from tutorials. Also I managed to run the code using mac's command line, aka terminal, with the command "php helloWorld.php". Been trying to figure out if the problem is with MAMP; did I install it wrong or is there something wrong with the apache server or what. I was hoping this to be more like the "install and you're ready" kind of package they promised it would be. But if there are any php gurus out there, any words of courage would be appreciated.
Create an account or sign in to comment