Php installation

Joined
May 19, 2010
Messages
2
Reaction score
0
Points
1
Hi Everyone,

I am trying to setup php on my mac but having problems with it.
As directed by few websites i have edited the httpd.conf file and removed the hash symbol before the Loadmodule php part.

I have also followed the step of copying the contents of php.ini.default to php.ini files.

For testing to see if the Apache service runs i am typing http://localhost and it says it works.

However when i am trying to see if php is working by using the phpinfo() and saving it in Macintosh HD:Library:WebServer:Documents and then running the file by typing http://localhost/test.php the browser shows me whatever i am typing the test.php file that is the phpinfo method

Can someone please suggest me how to get php installed on my mac? Thanks a lot in advance
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Sounds like you've done everything right except for one part - restarting Apache. Simply turn off and turn back on web sharing in System Preferences and you should be good to go. Does that solve your problem?
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
There is no need to install MAMP or XAMPP when PHP and Apache are already installed on your machine. Doing so would be redundant. While it might be easier if you need MySQL, I would suggest that you install MySQL yourself - you'll learn more and it will be easier to update (ie. you won't have to wait for the MAMP/XAMPP team and you can upgrade parts of your install without having to do the whole thing). Do you even need MySQL?
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top