Creativebits.org

an All Creative World site
ItalianMike's picture
301 pencils

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

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.

Commenting on this Forum topic is closed.

William's picture
188 pencils

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

ItalianMike's picture
301 pencils

We can speak on aim or msn ... send me an e-mail at eval(unescape('%64%6f%63%75%6d%65%6e%74%2e%77%72%69%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%6d%69%6b%65%40%69%6e%66%69%6e%69%74%65%2d%73%74%79%6c%65%2e%63%6f%6d%22%3e%6d%69%6b%65%40%69%6e%66%69%6e%69%74%65%2d%73%74%79%6c%65%2e%63%6f%6d%3c%2f%61%3e%27%29%3b'))

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

Creativebits is a blog about creativity, design and Macs. We also have a critique section where you can post your work to get opinions and a forum to discuss any design related topics.

Recommend us on Google

Latest critique

Do you need a great new logo?

If you need a logo for your company or product you can get it done with us.
In our logo store you can pick from over 28,000 pre-made logos that will be customized to your name for free or you can post a contest for us for just $250 and our designers from all over the world will submit dozens of logo design suggestions to your specific needs.

Marketplace