I tried to manually set up a PHP, IIS enviroment on windows 7, but it didn't work. I tried it hard, but never succeeded.
What's the fastes and most sure way to set up php with IIS on windows?
You can use the Web Platform Installer from MS:
http://www.microsoft.com/web/gallery/install.aspx?appid=PHP53
Or php.net has instructions for installing php under IIS:
http://php.net/manual/en/install.windows.iis7.php
Fastest way to install php on Windows servers is by using PHP Manager for IIS.
This will do all the manual stuff like installing php runtime, configuring the fastcgi for iis , make sure everything runs fine is check phpinfo() ,also makes it easier to enable/disable php extensions.
But doing manually as linked by other answers will teach you all the things this tool does automated.so if something breaks,It will be easy for you to fix it.
Related
I am returning to php after a long time (although I have a very basic understanding of php in general), and understand that I can run a php server locally by running the command now with version 5.6:
php -S localhost:8080
Do I still need to install XAMP or WAMP as many of the online tutorials are suggesting or am I okay to just use the above command?
Note: I have postgresql installed on my computer already and do not use mysql, if that matters at all
You need a webserver which you prefer depends on you. XAMPP is the most used for private but you could also take a look at BigApache, EasyPHP, PHPTriad, MampServer, WampServer.
Xampp is a combination of below
Apache server
Mysql server
PHP
and others.
This is a pretty famous and most used package. But if you want to install everything manually then thats even better you can control your server in any way you want. Go for it and you will learn more about it.
If you want a very flexible development environment you need to use a package like EasyPHP Devserver (http://www.easyphp.org/) or equivalent.
Is there a tool or extension for a browser to working with PHP offline? I read about you need to install an Apache server.
Is there an easier way to view offline in browser to see how the PHP code executes?
XAMPP sets up a local install of MySQL, PHP, and Apache that you can develop on.
In Windows, install XAMPP or WAMP
Which are Windows Apache Mysql and Php bundles
In Linux install LAMP
Which is a Linux Apache Mysql and Php bundle
Both of which could help
Nope, simpler than xampp is not possible.
This won't be much use to you now, but there has been recent talk (and submission of code) of providing a built-in web server into PHP itself.
See the RFC at https://wiki.php.net/rfc/builtinwebserver
You could then write your script (e.g. app.php), execute php -S localhost:8000 to start the web server and then see the results in your browser at http://localhost:8000/app.php.
In the mean time, you can install Apache/PHP/MySQL/etc. on your local box, as the other answers have suggested, either manually or with a package like XAMPP.
No. PHP code must be processed by a PHP engine, and the easiest way to do so in a web environment is to use a web server. It does not need to be httpd, but it must be something.
if you are on a Mac, you have Apache installed already. the additional instructions you will need to add PHP and MySQL database server can be found here http://www.entropy.ch/software/macosx/
if you are using Windows, XAMPP is a self contained Apache/MySQL/PHP environment that runs as a stand alone application.
that should get you started. good luck
I have been trying to install PHP 5.3.6 on a clean install of Win2003, no dot net or anything else much installed. Unfortunately I have tried 'thread safe', 'non thread safe', installer file, zip file etc. but whatever I try PHP just doesn't seem to work. I have also installed Microsoft C++ 2008 redistributable as suggested on PHP site but still nothing.
Any suggestions on how I should actually be installing this properly. There seems to be vague and at times conflicting instructions on the PHPweb site.
Make sure that you have told IIS how to handle PHP files.
In IIS Manager, expand the tree and find web service extensions, then make sure you have a spot for PHP, pointing to the php dll.
then make sure that your MIME types are set up correctly. Right click your website under Web Sites, view properties, then the HTTP Headers Tab. Click the MIME Types button, and make sure you have an entry for PHP.
This is how we got it set up in IIS Manager. Hope it helps you too.
Further investigation suggests that PHP 5.3.x will only work with IIS using FastCGI; isapi is no longer supported hence the reason that PHP5isapi.dll is missing. Unfortunately FastCGI cannot be installed on IIS without first installing Microsoft Web Platform Installer which requires dot net to be installed first.
This is crazy, PHP are effectively insisting that dot net is a pre-requisite for PHP - madness!
And further investigation reveals I was wrong - it is now installed and working.
Download and install FastCGI from here:
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=227219AA-6AEC-4B80-A9FA-76F811EE9E84&%3Bdisplaylang=en
This is a simple .msi install, no dot net required.
Restart IIS
Then download the NON Thread Safe PHP and install to IIS FastCGI Server option.
Now all working.
Here's how I installed PHP 5.3 on IIS 6 (running on Windows 2003 server):
http://www.howtoadvice.com/PHPIIS
This document is a little old and outdated but you should be able to use Web Platform Installer to install PHP on IIS6 for you.
I wanted to know, is a server that supports ASP.NET and PHP on the same box common? wordpress/mediaWiki/phpBB3 seem like a nice combo but i am developing a ASP.NET project.
Most windows webhosts support PHP as well. Big drawback to PHP being lack of URL rewriting support. IIS handles multiple handlers pretty well, so running both concurrently isn't even particularly tricky.
Take a look at the Microsoft Web Platform if you want to have a drop in replacement, otherwise PHP will install into IIS as a SAPI module or, if you are using IIS 7 you can also run it as FastCGI.
php|architect is also giving away the May 2009 issue which is all about running PHP on Windows.
Using IIS will certainly help you.
Download Microsoft's PHP for IIS, here, http://www.microsoft.com/web/platform/phponwindows.aspx
This'll help you start.
Don't forget to edit php.ini either in C:/Windows, or whereever the application was installed to, in order to ensure everything is set optimally for you.
We know PHP hasn’t always run smoothly on the Windows platform, so we’ve now optimized Windows Server to support your PHP applications through a new component: FastCGI. FastCGI works as an interface between PHP engine and IIS, and it ensures that PHP runs much faster than with CGI and way more reliable than PHP ISAPI.
with IIS you can host Asp.net and PHP
Another option is the Phalanger project that integrates PHP so you can use it either separately or inside ASP.NET on IIS.
It is compiled down so it should run much faster than standard interpreted php.
Phalanger
You could use Ubuntu Server (which a variety of hosting providers offer), among other GNU/Linux distros. Take a look at http://www.google.com/search?q=ubuntu+server+hosting , then just get apt-get Mono for ASP.NET, along with PHP 5:
sudo apt-get install mono-xsp2 php5
and anything else you need.
I want to do a sample program in PHP on Windows XP.
Do I need any special software to get this to work?
I am afraid that I simply open notepad type the PHP program and save it with php extension. Then I open it with the browser as a HTML file. But it does not work.
Please help
Thanks in advance
However you decide to install a webserver and php (or just php and use it in the console like someone mentioned):
Check out the PHP Manual, especially the Getting Started section.
Apache (Very, very easy)
Check out the WampServer getting started presentation.
Download and install WampServer.
And you are ready to go.
Microsoft (Not tested this myself)
Check out PHP on Windows.
Download and install the Microsoft Web Platform Installer.
Let me know how that work out... (never tried it myself, since WampServer is so easy)
You need to have a web server with PHP installed on your PC to make this work.
I highly recommend installing wampserver on your computer. It is a Windows installer that will put PHP, MySQL and Apache in your computer and let you manage all the services and such very easily. If you have problems getting it to work, you can also try out XAMPP, although I've never used it myself.
Some answers containing the hint for using wamp.
You should better use the Zend Server Community Edition.
This is also free and can be downloaded here:
http://www.zend.com/de/community/zend-server-ce
This contains Apache, Mysql, PHP and some Zend related Tools.
Benefit: its much better preconfigured than wamp.
Another easy one to set up (though it takes extra config to support PHP5) is easyPHP
you can simply install PHP, and then run the program and redirect the output
php foo.php > output.html
and then use any browser to open up that html file.
Since you have IIS on the windows cd I would suggest you go to control panel, install/uninstall programs and click on windows components and install IIS. Then install ASP.NET 3.5 from www.asp.net and finally install Phalanger from http://www.php-compiler.net/
That will give you the benefit of both worlds, you can program in ASP.NET using PHP as the language, you can use only PHP if you prefer that or you can mix using ASP.NET/C# on some pages and PHP on other pages within the same application.
I use XAMPP, works out of the box with his installer and is more than enough for a simple developer windows environment.
The simplest way - use www.microsoft.com/web platform installer. get the whole stack to run PHP all from one place.
i would like to share that before starting PHP we have to set environment for that and then we can start working with PHP.
http://code.freefeast.info/php-tutorials/setting-up-the-environment-for-php-php-tutorial/