A simple PHP code...
Moderator: General Moderators
Another thing about require and include(_once) is that the extension of the included file does not have to be any certain extension. You can leave the extensions .html as long as they have no PHP that you need parsed. If the two pages are pure html (no server side scripting I mean), then don't worry, the extension can stay the same.
Good luck with your future coding ventures.
Good luck with your future coding ventures.
http://se.php.net/downloads.php to download PHP.
But the hazzle comes when choosing the webserver. Most will recommend Apache, but it might require abit more editing and tweaking. http://httpd.apache.org/.
You can also go with the Microsoft IIS server, but I've personally never used that.
Go for a try, read the manuals PHP has some good usercomments regarding installation) and get back to us if you have problems...
But the hazzle comes when choosing the webserver. Most will recommend Apache, but it might require abit more editing and tweaking. http://httpd.apache.org/.
You can also go with the Microsoft IIS server, but I've personally never used that.
Go for a try, read the manuals PHP has some good usercomments regarding installation) and get back to us if you have problems...
- Derfel Cadarn
- Forum Contributor
- Posts: 193
- Joined: Thu Jul 17, 2003 12:02 pm
- Location: Berlin, Germany
...and you'll need Apache too, I suppose. Just to be able to test your scripts on your own PC.volka wrote:yes, it's called php and can be downloaded from http://php.net/downloads
I have php, apache and mysql installed on my home computer (XP) and it only took me about an hour, at most, to setup all three. I haven't really done much editting of the Apache configs...they pretty much run fine without any intervention. I've had to tweak the php.ini a couple times, for some stuff I wanted, but other than that, it's pretty much just install and run.
It's kinda cool having my own little "intranet" too.
It's kinda cool having my own little "intranet" too.
With "Editing and tweaking" I mean that a good host has all or nearly all extensions PHP supports loaded.
A default installation of Apache, PHP and Mysql lacks features as using mcrypt, the GD-libraries, Oracle, MSSql etc. etc.
If you are designing something that is to work at home as well as at your host, you likely need to start tweaking around in the php.ini you have at home.
Alot of people complains that "ths works at home, but not at my host" and that is often due to these facts (errorlevel reporting are set differently, include-dirs are different etc.)
Try this at your host, and at the newly installed at home.
A default installation of Apache, PHP and Mysql lacks features as using mcrypt, the GD-libraries, Oracle, MSSql etc. etc.
If you are designing something that is to work at home as well as at your host, you likely need to start tweaking around in the php.ini you have at home.
Alot of people complains that "ths works at home, but not at my host" and that is often due to these facts (errorlevel reporting are set differently, include-dirs are different etc.)
Try this at your host, and at the newly installed at home.
Code: Select all
<?php
phpinfo();
?>I followed the install wizards for PHP 4 and Apache 2, and then I added some lines to the httpd.conf, but I don't know what to do now, and I didn't know what to enter when asked for my server (to replace localhost). And do I install for a module or CGI? And when It is installed, how do I view my pages - in IE?
I think I have them installed properly now - but I can't change the web directory, i.e. the directory that comes up when I type http://localhost/ on my browser. I want it to point to a folder on my desktop.
in your httpd.conf there is a property DocumentRoot which you have to change.
- open/edit httpd.conf
- find # DocumentRoot: The directory out of which you will serve your
- change DocumentRoot
- find # This should be changed to whatever you set DocumentRoot to.
- change <Directory "..previous value of DocumentRoot..">