Perakp Posted February 16, 2012 Share Posted February 16, 2012 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. Link to comment Share on other sites More sharing options...
obfuscator Posted February 16, 2012 Share Posted February 16, 2012 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 Link to comment Share on other sites More sharing options...
Perakp Posted February 17, 2012 Author Share Posted February 17, 2012 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. Link to comment Share on other sites More sharing options...
obfuscator Posted February 17, 2012 Share Posted February 17, 2012 Are you using MAMP Pro? "It's not a rest for me, it's a rest for the weights." - Dom Mazzetti Link to comment Share on other sites More sharing options...
Perakp Posted February 17, 2012 Author Share Posted February 17, 2012 I've tried both mamp and mamp pro (trial version) Link to comment Share on other sites More sharing options...
obfuscator Posted February 17, 2012 Share Posted February 17, 2012 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 Link to comment Share on other sites More sharing options...
kveldalf Posted June 11, 2012 Share Posted June 11, 2012 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now