Hey all,
I'm just starting out with php, and I'm having trouble getting apache to parse the code.
I'm working on OSX 10.5.7
I installed Apache 2.2.11
I installed PHP 5.3.0 via the entropy package at http://www.entropy.ch/software/macosx/php/
I installed mySQL 5.1.36
Then I restarted my apache server, created a php file with the contents <?php phpinfo(); ?> and put it in my local host directory. When I opened it with a browser (via http://localhost/~user/my_phpinfo.php) it just read back the contents of the file to me rather than parsing it. However, local host index loaded just fine.
Then I tried using XAMPP. I installed it and created an identical php and put it in the xampp local host directory. I loaded up xampp, which claimed to have no trouble accessing the server or the mysql, but still didn't parse the file.
Then I uninstalled XAMPP and tried using MAMP with the same results.
Then I went into the terminal and backed the httpd.conf file. Then went into the original .conf file with nano and uncommented the "LoadModule php5_module" line, saved the file, restarted the apache server and tried again. It still won't parse the code. I've restarted the computer and tried again and it still won't work.
Again, apache isn't having trouble loading pages from the local host, but for whatever reason it isn't processing the php I feed it.
I have php 5.3.0 running at /usr/local/php5/bin/php from the entropy package and also php 5.2.8 running as the default. I'm not sure which one the system is using right now. Could that be part of the problem?
I've been banging my head against this for about 7 hours and I can't figure out what I need to do. If anyone could help me I would be eternally greatful!
apache won't parse
Moderator: General Moderators
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: apache won't parse
I would recommend trying to get one thing at a time working. First would be Apache + PHP. I don't know the entropy package, but the standard XAMPP should work. Maybe Mac users here can recommend which stack they use. Once that is working then sort out MySQL.
(#10850)
Re: apache won't parse
In addition to reinforcing what arborint said, I would discourage you from having more than one version of PHP loaded. I think I would delete everything related to PHP and reinstall (personally, I wouldn't install the very latest version, it might be so new that your Apache install package doesn't yet support it). Yes, you certainly have to uncomment the LoadModule statement in httpd.conf, and you also need another line that tells Apache where the PHP.ini file is. I have no idea what a Mac install requires, but the 2 lines in my Windows WAMP httpd.conf file are:
Now, the CRUCIAL point is that those files have to be in those locations for this to work. So one of the first things to do is to look in those directories and see if those files are there!
Code: Select all
PHPIniDir "C:/Program Files/PHP/"
LoadModule php5_module "C:/Program Files/PHP/php5apache2_2.dll"Re: apache won't parse
Check your apache error_log