/    Sign up×
Community /Pin to ProfileBookmark

PHP Enabled Web Server

Hey i’m looking to install a simple easy to use webserver on my pc so i can test my php scripts without having to be connected to the internet does anybody know any good ones? thanks in advance.

to post a comment
PHP

39 Comments(s)

Copy linkTweet thisAlerts:
@nawocOct 02.2005 — If you have downloaded PHP to your computer (http://www.php.net/downloads.php) and have enabled IIS then you already can - save the file to C:Inetpubwwwroot then in your browser type http://localhost/name of file (skip out the last bit if you save it as index.php)

In the above I've assumed you are using windows 2000 or XP professional (home doesn't come with IIS)
Copy linkTweet thisAlerts:
@bringerofnightauthorOct 02.2005 — Thanks i'll look into them.
Copy linkTweet thisAlerts:
@bringerofnightauthorOct 02.2005 — By the way how do you activate IIS and where should i extract PHP 5.0.1 to?
Copy linkTweet thisAlerts:
@nawocOct 02.2005 — to install IIS open control panel > Add/remove programs > Add/Remove Windows Components, and select Internet Information Services (IIS) from the list of components.

  • 1. Unzip the file you downloaded from the PHP website into a directory of your choice. I recomment C:PHP and will refer to this directory from this point onward, but feel free to choose another directory if you like.


  • 2. Find the files called php5ts.dll and libmysql.dll in the PHP filder and copy them to the system32 subfolder of you Windows folder (e.g. C:WINDOWSsystem32).


  • 3. Find the file called php.ini-dist in the PHP filder and copy it to your Windows folder. Once it's there, rename it php.ini.


  • 4. Open the php.ini file in your favourite text editor (use WordPad if Notepad doesn't display the file properly). It's a large file with a lot of confusing options, but look for a line that begins with extension_dir, and set it so that it points to the ext subfolder of your PHP filder:


  • extension_dir = "C:PHPext"

    Even further down, look for a line that starts with session.save_path and set it to your Windows TEMP folder:

    session.save_path = "C:WINDOWSTemp"

    Save the changes you made and close your text editor.



    Now, with IIS, follow these instructions:

  • 1. In the Windows Control Panel, open Administrative Tools > Internet Information Services.


  • 2. In the tree view, expand the entry labelled local computer, then under Web Sites look for Default Web Site. Right-click on the site and choose properties.


  • 3. Click the ISAPI Filters tab, and click Add... In the Filter Name field, type PHP, and in the Executable filed, browse for the file called php5isapi.dll in the PHP folder. Clock OK.


  • 4. Click the Home Directory tab, and click Configuration... button. On the Mappings tab, click Add. Again choose your php5isapi.dll file as the executable (note that the file type filter in the dialog is set to show .exe files only by default) and type .php in the extension box (including the .). Leave everything else unchanged and click OK. If you want your Web server to treat other file extensions as PHP files (.php3, .php4, and .phtml are common choices), repeat this step for each extension. Click OK to close the Application Configuration widow.


  • 5. Click the Documents tab, and click the Add... button. Type index.php as the Default Document Name and click Ok. This will ensure that a file falled index.php will be displayed as the default document in a given folder on your site. You may also want to add entries for index.php3 and index.phtml.


  • 6. Click OK to close the Web Site Properties window. Close the Internet Information Services window.


  • 7. Again, in the Control Panel under Administrative Tools, open Services. Look for the World Wide Web Publishing service near the bottom of the lost. Right-click on it and choose Restart to restart IIS with the new configuration options. Close the services window.


  • 8. You're done! PHP is installed!


  • If you want MySQL as well theres a few extra steps but I won'y post them unless you say you need them. This is a complicated procedure but well worth it - Anyone else spots any errors please post them a.s.a.p as they could cause problems otherwise.

    Good luk and dont forget to post how it goes
    Copy linkTweet thisAlerts:
    @bokehOct 02.2005 — Unless you can think of a good reason otherwise, install apache not IIS.
    Copy linkTweet thisAlerts:
    @rch10007Oct 02.2005 — Have you considered an all in one for testing? If you aren't looking for the experience of setting up the server and more interested in testing, you could try something like:

    http://www.apachefriends.org/en/xampp.html

    or

    http://www.appservnetwork.com/

    I use XAMPP. It installs itself without configuring numerous files. Download, install, test code - pretty easy to start.

    Good Luck!
    Copy linkTweet thisAlerts:
    @VoodooSteveOct 02.2005 — You should also check out [url=http://www.easyphp.org]EasyPHP[/url], it's Apache, PHP, MySQL and PhpMyAdmin all in one and it's really easy to use.
    Copy linkTweet thisAlerts:
    @bringerofnightauthorOct 03.2005 — I've figured out that my pc cam with php 5.0.1 installed (my pc's really new) and phpmyadmin and MySQL and apache i use them but my IP is dynamic does anyone know how other people could see my files i have on my localhost is this even possible?
    Copy linkTweet thisAlerts:
    @bokehOct 03.2005 — Basically all you need to do is open your firewall on port 80. Also if you are using a router you will need to forward port 80 to the machine with the webserver running. For the dynamic IP issue just sign up with a free DNS server like dyndns.org. They do a free updater as well for when your IP changes.That's all there is to it. Lastly, it's not unknown for ISPs to block requests made to server ports.
    Copy linkTweet thisAlerts:
    @FreeBSDWorldOct 03.2005 — Apache2, PHP5, and MySQL 5 are all very easy to setup on FreeBSD ??
    Copy linkTweet thisAlerts:
    @SheldonOct 03.2005 — Apache2, PHP5, and MySQL 5 are all very easy to setup on FreeBSD ??[/QUOTE]

    Haha nice pitch for freeBSD, Linux Debain is easier to use, But then again...

    Someone has to use it ?

    No digging at you.


    Go MacOSX!!!!!!
    Copy linkTweet thisAlerts:
    @SheldonOct 03.2005 — But then again, we are trying to help with a windoz set-up. appserv sets up everything too, one install page, sets up apache, php,mysql, phpmyadmin and comes in 2 versions one with php4.x apache 1.3.x and the other with php5.x and apache 2.x

    How is the set up going [b]bringerofnight[/b]? Did you manage to srt yourself up with dyndns, it is easier if you have a domian name to point to as well. Then set up your router for all port 80 access to point to your computer, Also make sure your computer has a static ip on your network too.
    Copy linkTweet thisAlerts:
    @bringerofnightauthorOct 03.2005 — My PC doesn't have an static IP what should i do btw i installed PHP5,MySQL,PHPMyAdmin,and Apache2. does anyone have any good ideas about some good php scripts i could use on my testing site.
    Copy linkTweet thisAlerts:
    @SheldonOct 04.2005 — [url=http://www.dyndns.com/]dyndns[/url] and configure your router to point your external ip to your internal ip of the computer you want to use. Make sure your internal computer has a static ip.
    Copy linkTweet thisAlerts:
    @bokehOct 04.2005 — My PC doesn't have an static IP what should i do btw i installed PHP5,MySQL,PHPMyAdmin,and Apache2. does anyone have any good ideas about some good php scripts i could use on my testing site.[/QUOTE]Are you behind a router? When you say your PC doesn't have a static IP do you mean the WAN IP?
    Copy linkTweet thisAlerts:
    @SheldonOct 04.2005 — does anyone have any good ideas about some good php scripts i could use on my testing site.[/QUOTE]

    What sort of scripts? What are you trying to do or rather what would you like to do? I have alot of scripts as does alot of other people but hwta do you want to do?

    go to http://www.hotscripts.com and have a look, many for free and there are thousands!
    Copy linkTweet thisAlerts:
    @AndrewpcaOct 04.2005 — I have apache and IIS installed - I have tried to open a test.php file with both of them, with the correct settings for each and nothing happens. an IE window does not even open. ANy idea what the problem might be? Thanks.
    Copy linkTweet thisAlerts:
    @AndrewpcaOct 04.2005 — ......I AM behind a router if that makes a difference? does it?
    Copy linkTweet thisAlerts:
    @bokehOct 04.2005 — I have apache and IIS installed - I have tried to open a test.php file with both of them, with the correct settings for each and nothing happens. an IE window does not even open. ANy idea what the problem might be? Thanks.[/QUOTE]
    Do you mean you have to servers running on port 80 at the same time?
    Copy linkTweet thisAlerts:
    @AndrewpcaOct 05.2005 — no - only one at a time. but neither seems to work. Yeh they both run when I start them and they both seem to have the correct settings. But PHP files will not open. If I try to open test.php or similar, then nothing happens. I then try switching servers, changing the settings in my PHP files to accommodate the different server software and still nothing. Frankly it's a pain in the arse! Does the fact that I am behind a router have any effect then? Thanks
    Copy linkTweet thisAlerts:
    @LiLcRaZyFuZzYOct 05.2005 — where do you save your php files?

    do you access them through localhost?
    Copy linkTweet thisAlerts:
    @bokehOct 05.2005 —  Does the fact that I am behind a router have any effect then? Thanks[/QUOTE]Only if you are trying to access from another machine.

    How are you trying to access your php files? what exactly are you entering into the web browser?
    Copy linkTweet thisAlerts:
    @AndrewpcaOct 05.2005 — the php files are saved in the "htdocs" folder if I use Apache and in the wwwroot folder if I ise IIS. In each of these folders I have identical test.php files which, when doubleclicked do not open. similarly when the localhost address is typed into the web browser the page cannot be found. It's driving me NUTS because I want to crack on and get this site developed!

    I'm not bothered about accessing them from another machine yet, I will set up a deidicated server with its own phone line when I move into my new offices, but there's a few months (well, for me anyway) of site construction to come first.

    Thanks guys
    Copy linkTweet thisAlerts:
    @AndrewpcaOct 05.2005 — i enter into the web browser http://localhost/test.php
    Copy linkTweet thisAlerts:
    @bokehOct 05.2005 — What happens if you just type http://localhost/ into the browser?
    Copy linkTweet thisAlerts:
    @AndrewpcaOct 05.2005 — well....using IIS, I get the message, my server is running (there is no default page yet) If I put an index.htm page in there it doesn't display that either.... unless I type the full address. It won't display PHP files so I guess there's a problem with php somewhere. Thanks.
    Copy linkTweet thisAlerts:
    @LiLcRaZyFuZzYOct 05.2005 — and with apache running?
    Copy linkTweet thisAlerts:
    @bokehOct 05.2005 — You need to move forward methodically. Be decisive! Decide which server you will use. My choice would be apache. Once you make that decision than we can give you help in that one direction.
    Copy linkTweet thisAlerts:
    @LiLcRaZyFuZzYOct 05.2005 — apache is fine! go for it, get rid of the other!
    Copy linkTweet thisAlerts:
    @AndrewpcaOct 06.2005 — Well, Apache runs seemingly well. But if I type in http://localhost/ then I still get the index page that I placed in my IIS server document root.

    I'd like to use apache because everyone seems to recommend it far above IIS and they all seem to know what they are talking about. haha!

    ok - I have the following lines in my httpd.conf file in apache:

    ServerRoot "C:/Program Files/Apache Group/Apache"

    LoadModule php5_module c:/php/php5apache.dll

    AddModule mod_php5.c

    DocumentRoot "C:/Program Files/Apache Group/Apache/htdocs"

    AddType application/x-httpd-php .php

    Format: Action application/x-httpd-php "/php/php.exe"

    so....where am i? apache works and I would prefer to use it but php files in my apache document root will still not open not does the web browser think that apache is my server, its still looking at the IIS server.

    Thanks
    Copy linkTweet thisAlerts:
    @AndrewpcaOct 06.2005 — I have uninstalled IIS and apache now works - the web browser finds files in the document root of apache. my text.php file opens through the web browser however I cannot open a php file by double clicking on it. Is this normal?

    test.php reveals this as it should:

    System Windows NT PIONEER-AWM 5.1 build 2600


    Build Date Sep 5 2005 15:50:13


    Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--with-gd=shared"


    Server API Apache


    Virtual Directory Support enabled


    Configuration File (php.ini) Path C:WINDOWSphp.ini


    PHP API 20031224


    PHP Extension 20041030


    Zend Extension 220040412


    Debug Build no


    Thread Safety enabled


    Zend Memory Manager enabled


    IPv6 Support enabled


    Registered PHP Streams php, file, http, ftp, compress.zlib


    Registered Stream Socket Transports tcp, udp


    Thanks for your help.
    Copy linkTweet thisAlerts:
    @LiLcRaZyFuZzYOct 06.2005 — yes it is normal, if you really want to, you can make a shortcut
    Copy linkTweet thisAlerts:
    @AndrewpcaOct 06.2005 — a shortcut? what do you mean?

    As a complete aside - I am now about to begin the behemoth. I have heard it advocated that tables are a seriously BAD idea for a page template? Do you know why? Or is this just some guys being snobbish?

    Thanks fuzzy...you've helped me before. I'm very grateful
    Copy linkTweet thisAlerts:
    @LiLcRaZyFuZzYOct 06.2005 — no, no it's not guys being snobish, it's because tables are for tabular data

    you must style the layout with css

    well, in windows for example, in a directory right click>new>new shortcut

    type the adress "http://localhost...blablahblah..index.php"

    and when you click the shortcut, a browser window will open and go to that page
    Copy linkTweet thisAlerts:
    @AndrewpcaOct 06.2005 — oh i see - THAT sort of shortcut. I've already done that. haha!

    and since I'm not really bothered about sounding thick - what the hell is CSS?
    Copy linkTweet thisAlerts:
    @LiLcRaZyFuZzYOct 06.2005 — well, CSS stands for Cascading Style Sheet, and is used with markup to style the page, not only style the appearance of elements but also the position, the size, etc...

    you might want to read this

    http://www.w3schools.com/css/
    Copy linkTweet thisAlerts:
    @FreeBSDWorldOct 10.2005 — 
    Go MacOSX!!!!!![/QUOTE]



    At Work I'm on Mac OS X servers all day. I still like FreeBSD better but that is just personal preferences. Open source allows for this for freedom of choice ?
    Copy linkTweet thisAlerts:
    @LiLcRaZyFuZzYOct 10.2005 — im so in love with the Mac OSX interface, it's...awsome
    ×

    Success!

    Help @bringerofnight spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.1,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,

    tipper: @Samric24,
    tipped: article
    amount: 1000 SATS,
    )...