Skip to content
View in the app

A better way to browse. Learn more.

Tip.It Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

MAMP and PHP

Featured Replies

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.

Does the server work properly with plain html files?

 

Do you have a phpinfo file that you've tried to run?

polvCwJ.gif
"It's not a rest for me, it's a rest for the weights." - Dom Mazzetti

  • Author

Plain html works fine

 

Running phpinfo();, I got hundreds of rows of information. Most peculiar lines were

 

Configuration File (php.ini) Path => /etc

Loaded 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.

Are you using MAMP Pro?

polvCwJ.gif
"It's not a rest for me, it's a rest for the weights." - Dom Mazzetti

  • Author

I've tried both mamp and mamp pro (trial version)

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.

polvCwJ.gif
"It's not a rest for me, it's a rest for the weights." - Dom Mazzetti

  • 3 months later...

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

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.