Quantcast

Problems with offline version of my website (OS-X related)

ItalianMike's picture

I recently set up my website to use PHP includes to load the header and footer of my layout (thanks to miljee for all the help) Now this work perfectly online, however it's completely crashed the offline version I keep in my "sites" folder.

To start off with I'd like to say that I have "personal web sharing" activated, and that before moving to this include system the entire website ran perfectly in my "sites" folder.

Having messed around with this for the last day or so, here is what I think is wrong. In order to use the PHP includes on my server I was forced to use absolute urls to draw up my header.php, footer.php, and site.css files.

So for example on my main index page the include line for the header is:

include ("include ("/home2/www/infinite-style/includes/header.php");

In order to try and mimic this in my sites folder I've created folders in the same path as on my server, so it goes:

sites / home2 / www / infinite-style /

and then from there all of the website files lay. This however doesn't seem to work. Neither the header, footer, nor css file load at all.

Anyone had any suggestions on how I can fix this? I'm certain that it is in relation to using absolute urls. I really don't want to have to keep two versions of the site, that doesn't seem very effective.

Anyone here know the inner workings of the "site" folder in OS-X, maybe by using / at the beginning of the url, I'm actually going further out from the "site" folder into some hidden directory.

Any help would be appreciated.

William's picture

probably a permissions problem

This is probably a permissions problem.

In your main index.php you should call the header.php file using relative path.

There is no need to specify the entire path, in fact this will just lead to more problems as you can see.

your PHP file should look like this:
<?PHP
require 'include/header.php';
...
?>

This will help show an error if it can't find your file.

Also, have you enabled PHP in your local Apache config ? (Did you edit the httpd.conf)

How are you accessing your local site? You need to type in http://localhost/~mike/infinite-style/

Have a look at the apache access & error log:

tail -f tail -f /var/log/httpd/error_log

Let me know what it says there when you try to access your webserver.

Will

--
http://www.macscan.net/

ItalianMike's picture

anyway

We can speak on aim or msn ... send me an e-mail at

-------------------------------
Infinite Style

User login

Partner With Us













Latest critique

Bullet Energy Drink Final