ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

Help Request: Php files on Apache server not loading right

(1/3) > >>

barney:
Folk,

I give up.  I've been fighting this problem for a couple of weeks, now, and cannot deduce or find a resolution.

I've installed Apache 2.2, PHP 5.x, & MySQL on a 64-bit Win7 box.  However, PHP files merely display the page as PHP code, at best.  Both Apache and PHP are 32-bit, MySQL is 64-bit.  The box in question is an Intel i3 4-core, 4 GB RAM.
I had the same problem with Win XP, and I think I had it with Win 2K.  However, I do not recall what resolved it.

All the Apache and PHP forum efforts have been treated as RTFM, with an automatic assumption that the manual has not been read  :mad:.  Google [many] searches have revealed a significant number of resolutions - none of which have worked for me.  Some of those resolutions involved WAMP/XAMPP, but that hasn't worked, either.  I dislike using WAMP/XAMPP for several reasons, but I tried both, anyway.  The results were significantly less than optimal  :'(.

Bottom line - one of 'em, at least - is that I cannot test a couple of gigs of Web code on the laptop.  While I can run against the server just fine, I'm not always connected to the server.  Since I'm likely to experience vascular surgery in the near future, I really need to get the laptop up to speed in this respect, as there is no reason carving my drumstick(s) should keep me non-productive (if ever I was that  ;D).

As I recall previous corrections for the older OSes, it was httpd.conf & php.ini corrections, but I cannot remember those for the life of me.  If needful to see those files, I can put 'em up on a site - they're too long to post here, methinks.

mouser:
ok couple of quick simple questions first:

You say the PHP files merely display the page as PHP code text.

Are you for sure open the files through the apache web server? This is kind of an obvious question except i have dragged and drop local filed into my web browser before and been confused for a minute why the php wasn't being interpreted.  In other words, the php files, are you accessing them like http://localhost/myfile.php or http://127.0.0.1/myfile.php and not file://c:\myfile.php

Second question would be that it sure sounds like your apache httpd.conf file is not saying to interpret php files with the php interpreter.  One thing to watch out for is having multiple copies of httpd.conf in different locations and editing a useless one and wondering why the changes don't take.  you might want to first confirm that's not happening.

Then of course make sure you restart apache after you make a change.

Lastly, some recent changes made files that used to be marked as php with <? tags now can require <?php tags.  see if that's your problem.

barney:
All good points.

Access is via http://win74ggw/[php page or index.php] - localhost won't work, but that's due to entries in the httpd.conf file.

Only one copy of httpd.conf in existence - it's not correct, but it's the only one  :).  And, to verify the correct one is being edited, l'll usually make some innocuous but obvious change to be certain, then revert the change & try to do what I need to do  :tellme:.  (This is usually to change the index order from index.php to index.html, then back.)

Haven't used the short tag <? for years ... belt and suspenders attitude on most things  ;D.

There is one point you've inadvertently brought, though.  When system is booted, it may take several minutes before the Apache Monitor shows Apache as active.  It's also slow to restart via the Monitor.  My first thought was UAC issues, but that doesn't seem to be the case.  However, no discernible pattern, at times the restart will bring up the UAC permission window.

One other thing I should maybe mention is that I've seen complaints on restarting Apache that RewriteEngine is invalid in the .htaccess file in DocRoot.

Eóin:
Can you verify that mod_php is indeed loaded and running in Apache? Been years since I did this but I'm sure I remember there was some sanity test of sorts you could perform to make sure Apache and mod_php were fine before you'd then move on to configuring a site.

parkint:
What is the contents of the .htaccess file in the DocRoot?
A bad "Rewrite" line could be your problem.

Another [basic] question.  Do you get proper response from an HTML page?

Navigation

[0] Message Index

[#] Next page

Go to full version