Technical Discussion
  >> Web Design / HTML / Web hosting Forum


Register (or login) on our website and you will not see this ad.


These posts have been archived and can no longer be replied to or modified.
Pages in this thread: 1 | 2 | (show all)   Print Thread
Standard User camieabz
(legend) Tue 23-Nov-10 10:46:05
Print Post

Recommend an Apache server for Windows


[link to this post]
 
For local testing of .php files. Nothing fancy or complicated if you please. smile

Standard User micksharpe
(eat-sleep-adslguide) Tue 23-Nov-10 11:08:08
Print Post

Re: Recommend an Apache server for Windows


[re: camieabz] [link to this post]
 
I use WebFaction - multiple domains and websites on a single account - ideal for testing but can be slow at times.

P.S. Just realised - you seem to be asking for Windows hosting. Why don't you install Apache on your PC? XAMPP will install Apache, MySQL and PHP on Windows dead easy.

__________________________________________________________________________________________
"Windows Vista Sir?"
"No thanks, I'd rather shove wasps up my nostrils!" .
Mick's Blog | Greasemonkey scripts

Edited by micksharpe (Tue 23-Nov-10 11:12:17)

Standard User ian72
(knowledge is power) Tue 23-Nov-10 11:09:47
Print Post

Re: Recommend an Apache server for Windows


[re: camieabz] [link to this post]
 
Do you mean a host or a package for installing locally or the spec of hardware to run it on?


Register (or login) on our website and you will not see this ad.

Standard User camieabz
(legend) Tue 23-Nov-10 11:12:39
Print Post

Re: Recommend an Apache server for Windows


[re: ian72] [link to this post]
 
I mean a program that can be installed locally jsut to test php files locally, rather than upload them to a remote server to see if they work.

Free software btw. smile

Standard User micksharpe
(eat-sleep-adslguide) Tue 23-Nov-10 11:14:40
Print Post

Re: Recommend an Apache server for Windows


[re: camieabz] [link to this post]
 
Download and install XAMPP - job done.

__________________________________________________________________________________________
"Windows Vista Sir?"
"No thanks, I'd rather shove wasps up my nostrils!" .
Mick's Blog | Greasemonkey scripts
Standard User camieabz
(legend) Tue 23-Nov-10 13:20:24
Print Post

Re: Recommend an Apache server for Windows


[re: micksharpe] [link to this post]
 
Ta for that.

A little chunky at 51MB download and 230 Meg installed, but it does do the job. What's more, my php files work! grin

Standard User camieabz
(legend) Tue 23-Nov-10 14:43:19
Print Post

Re: Recommend an Apache server for Windows


[re: micksharpe] [link to this post]
 
Slight problem with the .php files calling on other files.

I have index.php, header.php and footer.php in the main folder, then have the css in a folder called 'css' and the images in a folder called 'img'.

Now the page works fine using relative paths (e.g. the header calls on "css/main.css"). However, if I create another .php file and put it in a new folder (e.g. test), I would call on the header and footer via:

<?php include '../header.php'; ?>

This works, but for some reason the css and images that the header calls don't work. It's as if they aren't being correctly 'pathed'.

My options seem to be:

Create a css and img folder for each sub folder which hold .php files, which defeats the whole point.

Keep all my .php files in the root folder.

Use absolute referencing (not keen on that, as it adds to file size, and makes changes more in depth).


Or am I doing something wrong?


One other thought.

Once I get the files created, I'll almost certainly want to have the title and meta tags within the head section different for each page. What's the best way to do this, given that my current global header calls from the Doctype declaration down to the first heading in the main body?

Standard User deleted
(deleted) Tue 23-Nov-10 15:30:34
Print Post

Re: Recommend an Apache server for Windows


[re: camieabz] [link to this post]
 
When you use the include command, it calls the file and adds it to the php script that is being run, so the relative paths in the header and footer files will be interpreted as if they are from the test file.

So for example, on my web server the header and footer files are in the parent folder of the web root folder. The relative links however are written as though they are in the web root folder. This works because of how php interprets them.

Basically you need to place all the php files that use the same CSS and image files in the same folder.

As to changing aspects this can be done easily by asigning a variable and then calling the header.

eg
Text
1
23
4
<?php
$page = test;include '../header.php';
?>


Then you can reference this within the header file for all the attributes you wish to change.

It would be best to do so with a switch statement.
Standard User deleted
(deleted) Wed 24-Nov-10 11:08:43
Print Post

Re: Recommend an Apache server for Windows


[re: camieabz] [link to this post]
 
you could call the css using the following code:

<link href="/css/style.css" rel="stylesheet" type="text/css" />

The leading / makes it start from the web root so it works regardless of what directory the php fileis in.

Edited by deleted (Wed 24-Nov-10 11:09:14)

Standard User camieabz
(legend) Wed 24-Nov-10 12:55:47
Print Post

Re: Recommend an Apache server for Windows


[re: deleted] [link to this post]
 
Ahh, spot on!

I had dumped all the files into a sub-folder, so needed to have as /subfolder/css/main.css, rather than /css/main.css

I forget about the 'root' folder aspect of things. Too used to windows.

Ta very much!

Pages in this thread: 1 | 2 | (show all)   Print Thread

Jump to