is there anythign i need to run a php web server?
Printable View
is there anythign i need to run a php web server?
Five things
A computer (clearly you have one of these already)
An OS (ditto)
A connection to the internet (ditto again)
A web server (Try www.apache.org)
PHP binaries (Get from www.php.net)
Install Apache, install PHP, follow configuration instructions to get them to work together. Run Apache, it should say "running PHP 4.1?".
15 minute job :cool:
You'll probably want to install mySQL at some time too (a db engine: a lot of boards and other scripts use it). http://www.mysql.com/, but beware it's a living hell to install for the first time.
??Quote:
Originally posted by filburt1
but beware it's a living hell to install for the first time.
under windows it's a piece of cake. Just use the winmysqladmin utilty (mysql root/bin) to create a my.cnf, and run the same again.
mysql was the easiest thing for me to install :confused:
took me 5 minutes to install mysqlQuote:
Originally posted by chrisjk
??
under windows it's a piece of cake. Just use the winmysqladmin utilty (mysql root/bin) to create a my.cnf, and run the same again.
thanks, is there anything i need to know. like how to get to my page?
when Apache installation asks for domainname, type 127.0.0.1
Then when you want to view php pages, open IE and type 127.0.0.1. You will get a dir listing on the stuff in apache root/htdocs
how could i make my own domainname?
if you want it accessible to people from outside like a normal webserver, you'll have to register a domain name in the usual manner and type it in the box asking for it.
The 127.0.0.1 is for localhost testing
Well thanks for making me feel bad :p, because I didn't want to install it to the default directory it made things really hard, so I just gave up and installed it to c:\mysql. Then I hunted around for half an hour until I was able to find out how to install it as a service, then everything was fine and dandy.
You can fake it using http://www.dns2go.com/ . For example turtletips.dns2go.com always resolves to my computer's IP. I have it set to send a heartbeat every 20 minutes, so if my IP changes due to DHCP, turtletips.dns2go.com will point to the new one.Quote:
Originally posted by chrisjk
if you want it accessible to people from outside like a normal webserver, you'll have to register a domain name in the usual manner and type it in the box asking for it.
The 127.0.0.1 is for localhost testing
Or you can spend $8.95 at http://www.godaddy.com/ and get your own real domain name.
im haveing problems installing the apache thing i really need help on that now
i dont know what command line its talking about
i didnt install it in c:\mysql and still took me 5 min :DQuote:
Originally posted by filburt1
Well thanks for making me feel bad :p, because I didn't want to install it to the default directory it made things really hard, so I just gave up and installed it to c:\mysql. Then I hunted around for half an hour until I was able to find out how to install it as a service, then everything was fine and dandy.
command line meaning the dos box that comes up. what are you trying to do?
click on the 3rd one
http://www.snippetlibrary.com/tutori...e=Installation
is it saying command prompt? if it is i tryed that it didnt work. it said it didnt know that command im trying to install the apache thing
You seem to have got lost a bit methinks.
What have you done so far?
i extracted all the apache files and i edited to conf file (kinda) but i dont know what to do after that mabey i did it wrong to begin with
did you put this in httpd.conf?
after following the instructions for PHP (i.e. installing it and copying the relevant files to the correct places)Quote:
LoadModule php4_module G:/php/sapi/php4apache.dll
#AddModule mod_php4.c
AddType application/x-httpd-php .php .php3
Also make sure you restart the Apache service...in a DOS console type:
You might also want to just type (in the Apache dir)Code:net stop apache
net start apache
And it will tell you if any of the conf files have errors.Code:apache
the easiest thing to do is forget consoles completely and have a shortcut pointing to apache.exe. You can then just minimise it
Ah, but then it won't run for all users on NT-based OSes ;)Quote:
Originally posted by chrisjk
the easiest thing to do is forget consoles completely and have a shortcut pointing to apache.exe. You can then just minimise it
?
like windows 2000, like i have you mean :p ;)
i have xp but it didnt come wiht an exe for the http thing thats what im working on so that i can get to the php part
did you get the source of binary distribution; because you definately want the Win32 binary distro.
where would it be ill look, do you have any instant message program that would probly be a lot easyer than posting
why would you want it to run for anybody else as it will be a test machine anyway.Quote:
Originally posted by filburt1
Ah, but then it won't run for all users on NT-based OSes ;)
i thought i had to have that.... i didnt know i just wanted to make it for my house. it would be a php MySQL thing can you tell me what i need then?
ok i got it installed but now i have no idea where the index files are that make my page
ok everything is installed but when i try to load a php file it shows it as text not as the web style
are you using IE and have you told apache to interpret all php extensions as a php file, like this
in httpd.confCode:LoadModule php4_module G:/php/sapi/php4apache.dll
#AddModule mod_php4.c
AddType application/x-httpd-php .php .php3
does it matter where i put it, because i just put it in and its still not working
It shouldn't matter, i put it at the end on mine
Did you follow these instructions
Quote:
Installing PHP on Windows with Apache 1.3.x
There are two ways to set up PHP to work with Apache 1.3.x
on Windows. One is to use the CGI binary (php.exe),
the other is to use the Apache module dll. In either case
you need to stop the Apache server, and edit your
srm.conf or httpd.conf to configure Apache to work with PHP.
Although there can be a few variations of configuring PHP
under Apache, these are simple enough to be used by the
newcomer. Please consult the Apache Docs for further
configuration directives.
Now that version 4.1 introduces a safer sapi module, we recommend
that you configure PHP as a module in Apache.
To do this, you should move php4ts.dll to the windows/system (for Windows 9x/Me)
or winnt/system32 (for Windows NT/2000/XP) directory, overwriting any
older file. Then you should add the following three lines to your Apache
conf file: (swap c:/php/ for your PHP install path)
LoadModule php4_module c:/php/sapi/php4apache.dll
AddModule mod_php4.c
AddType application/x-httpd-php .php
If you wish to install PHP as a CGI binary, (the sapi is much better)
you need to enable the apache security fix in your php.ini by
setting cgi.force_redirect = 1. Then, insert these lines to your conf file:
ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php.exe"
As a further precaution, we recommend you change the "/php/"
ScriptAlias to something more random, to prevent any attempts to
call your binary (like the Code Red scripts) for returning a response
other than 404.
Remember when you have finished to restart the server, for example,
NET STOP APACHE
followed by
NET START APACHE
To use the source code highlighting feature, add the following
line to your apache httpd.conf file:
AddType application/x-httpd-php-source .phps
Note, this will only work when you install php as a sapi module.
If you wish to use this feature with the cgi binary, create a new
file, and use the show_source("path/to/original_file.php"); function.
On Win-Apache all backslashes in a path statement such
as: "c:\directory\file.ext", must be converted to
forward slashes.
i did but its still messing up
ok i read it over again and its still lot loading php scripts right