Forum Moderators: phranque

Message Too Old, No Replies

Localhost Oddities

         

g1smd

11:28 pm on Apr 9, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I have set up an old machine for someone to edit and redesign their site offline. Their machine uses Windows ME and I installed Apache 1.3.37 and PHP 4.2.something (I think) quite a while ago.

They have just started to use it for the intended job but things are going badly wrong. I feel sure that everything worked when I initially set things up, but it sure doesn't now.

PHPinfo returns a whole load of data, but "PHP includes" aren't working at all. Mention is made of the file being missing from c:\php4\pear\ even though the Path to the Include File is specified in php.ini and in the .htaccess file.

Thinking about it, all the stuff in the .htaccess file is being ignored too. Can anyone think of a good reason for that?

The HOSTS file has been amended to force a "fake" development domain name, and it can also be accessed as 127.0.0.1 and as localhost too.

coopster

1:24 pm on Apr 10, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Either it isn't reading the correct php.ini or none at all (PHP comes with a "default" php.ini built-in). There are some details in regards to the subject in this thread [webmasterworld.com].

As far as .htaccess goes the first two things that come to mind are AllowOverride and AccessFileName [httpd.apache.org]

g1smd

1:23 am on Apr 12, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I think I already have all those bases covered, but I will check again shortly.

g1smd

12:47 am on Apr 18, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I checked it all again and found a number of problems that I had missed before.

The mod_rewrite and several other modules were no longer configured in http.conf. I added those back into the mix. That allowed redirects to start working again.

There was a typo in .htaccess where the folder path for PHP includes was declared as a php_value. Correcting that typo made the includes work immediately.

There was a typo in the PHP includes folder path value in php.ini too. Fixing that did not make it work, but fixing the typo in the .htaccess file did. I commented out the block of code in php.ini after that.

The final issue was that none of the images would load when looking at "localhost"... and that was quickly traced to the image-hotlinking-denial code doing exactly what it was programmed to do: deny all images if the referrer was not (www.)domain.com or blank.

They can now look at the site offline. This is done via localhost or 127.0.0.1 or dev.domain.com with the latter being "forced" by adding an entry to the HOSTS file on the PC.

I see that the page views of the site at 127.0.0.1 now appear in the Google Analytics stats too! Must add another filter there to stop those being counted.