mac + php
- Started
- Last post
- 28 Responses
- jakeyj
Ok i'm a total noob at this stuff.
I'm trying to get php working on my local compooter. I've installed XAMPP - and when i check the status, it tells me php is activated.
But when I view a site via localhost/~user/index.php, it just shows me the source code.
what am i doing wrong?
- Bender0
what am i doing wrong?
jakeyj
(Apr 5 06, 08:16)you are a noob
- jakeyj0
thanks bender
- Bender0
anytime jakeyj
- kelpie0
don't listen to jazX, jakey, he's the anti-noob
I installed it on PC recently, had no problems, worked first time - if the control panel is telling you apache, php, and mysql are all working it should be fine, unless its a mac issue...
- heavyt0
on your mac, you shoudl browse to:
http://127.0.0.1/~yourusernamethat is your Sites directory (where your php should be)
- kelpie0
'localhost' is a pc term?
- jakeyj0
i'm getting the same thing heavyt...
when the file has a .php extension it displays all the source code...
- UndoUndo0
have you configured php.ini???
- jakeyj0
nope - help me out. or should i google it
- UndoUndo0
I dont have enough experience with macs to help you. on pc you put the php.ini filw in yr wiondows directory. not sure where it would go on a mac.
your problem is that apache doesn't know to process .php as a server side script. hope that helps
- UndoUndo0
+ the download of php you've got should have come with a pjp.ini file for you to use and place in the correct directory, I just dont know what that is, Moth will probably know if he;'s about
- kelpie0
thing is undo, on PC at least the XAMPP thing downloads and installs all the gubbins in all the right places - I'd check their chat about macs, maybe the installer doesn't put all that stuff there
- jakeyj0
i've installed xampp and when i go localhost, it brings up the xampp status page, which is a .php file... and it tells me php is activated. i wonder why its reading that php file but not any others/
- kelpie0
have you tried kicking it yet?
- jakeyj0
yes - many times!!
- jakeyj0
the page it gives me is localhost/xampp/index.php - and it works
i put a file in that folder and it worked at localhost/xampp/test.php
but when i have the files in localhost/~user/text.php it doesn't work!
what gives?
- prophet0NE0
I use MAMP OSX as my local sql, php 'environment' and it works great. Highly recommended. My localhost directory is:
- UndoUndo0
~ < thats not a url character, try a folder named just with letters
- kelpie0
htdocs folder for your files?
- silentseven0
all you need to do is turn on the module in your httpd.conf file
open terminal and type this
sudo pico /etc/httpd/httpd.conf
hit ctrl+W search for php
remove the # marks infront of the LoadModule php4_module
search again for php remove the # mark in front of
AddModule mod_php4.chit cntrl c to exit and save then type this to restart apache
sudo apachectl graceful