PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, March 5, 2022

[FIXED] PHP not working on MAMP?

 March 05, 2022     mamp, php     No comments   

Issue

I'm new to this so please forgive me.

I have set up MAMP and am trying to run a PHP file (index.php). I have the green lights and have my index.php file inside the htdocs folder.

But nothing seems to show up in the browser.

Here is my setupenter image description here

I have done as told in the answers in this question running php on mamp

which includes:

http://localhost/index.php
http://localhost:8888/index.php

both give me a bank page.

I tried /Applications/MAMP/htdocs/index.php and it give me this.

enter image description here


Solution

Change this:

<php? echo"hello"; ?>

to:

<?php echo "hello"; ?>

The php's tags are:

<?php for opening and ?> for closing

Read the manual



Answered By - Emilio Gort
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing