FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


PHP Not Working on Localhost





Abfc
Well, here's my problem... I've installed PHP, Apache, and MySQL all successfully, and PHP works fine, as is shown by my deviantART bots running smoothly; however, when I open a PHP file on my local server (i.e. http://localhost/index.php) it merely renders the PHP source code as plain text.

Has anybody else ever experienced such a situation? If so, how did you solve it?
I really need to get this stupid server working right some time soon. I refuse to re-upload a PHP file to a web-server every 40 seconds just to preview my progress. It's too damned tedius. :/
eznet
Check out http://www.php-mysql-tutorial.com/install-apache-php-mysql.php . Look at the area titled "Modifying Apache Configuration" - have you told Apache that php was installed? I don't know if this tutorial applies to your versions, but the jist is the same - you need to let Apache know that PHP is there. Basically, from what I understand you need to add the following to your httpd.conf :

ScriptAlias /php/" c:/path-to-php-dir/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php.exe"
aningbo
why dont you just use some softwares which have everything ready. that way it saves a lot of time installing the crap. easyphp is free and you might wanna look at it. there are better ones out there. google it.
[FuN]goku
aningbo wrote:
why dont you just use some softwares which have everything ready. that way it saves a lot of time installing the crap. easyphp is free and you might wanna look at it. there are better ones out there. google it.
Or XAMPP is always good as well Razz
essey
PHP not working on localhost could be as a result of several things, which include:

1. Conflict with IIS: There could be a conflict between the Apache service (apache.exe) and the
IIS service (inetsvr.exe) that comes with Windows (if you installed it as an option).
2. The Apache service has not been configured to recognise PHP (this happens when PHP is installed
after Apache).
3. You did not save your files to the folder that Apache was configured to compile PHP scripts from.

Suggested Solutions:

1. Open the IIS Administration area, and stop the IIS service.
2. Edit the Apache settings using your software and make sure PHP is enabled. Check the referenced
scripts folder and make sure that's where your files are uploaded to.
3. BEST OPTION: Get a software that can handle this by installing all the packages you need in in one
package: http://www.wampserver.com/en/download.php

Success![/quote]
positive_vibes
I remember having this problem when I tried to install the packages separately. After wasting much time trying to solve the problem I ended up just ridding myself of the whole process. Instead of fighting with it, I found Wamp Server 2.0. I've noticed other replies suggesting other all-in-one localhost testing software and they work as well, but this is my personal favorite. You can check it out here.
jcvincent75
[FuN]goku wrote:
Or XAMPP is always good as well Razz


Yup. If you have problems on configuration, then XAMPP is the best way to go.
aningbo
XAMPP is the best. nothing's better than that.

i recommend u to download this copy and try it out. yeah u may need to read a little manual but u can go on with it too. good luck and hope u gt it done
justtj
Check the encoding of the php file you have saved, usually php works good with unicode formatting...

Also you can check in apache if you have set any aliases for your web server..
Related topics
HTTP AUTH with PHP and mySQL
[RESOLVED] RETARDED ERROR!
News and Comment system!
MySQL Database
a game online
installing apache,mysql and php on windows
[PHP] phpbb registration - add to other db
PHP Test File
[php] array reference
Why is it such a pain in the butt!
mysql gives the wrong result [solved]
Problem connecting to MySQL database with PHP [RESOLVED]
MySQL, PHP and APACHE
PHP without a webserver?
Help Simple PHP Problem
Reply to topic    Frihost Forum Index -> Computers -> Computer Problems and Support

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.