Установка в системах Windows
Содержание
Установка PHP в современных операционных системах Microsoft Windows и рекомендуемая конфигурация под распространенные веб-серверы.
Если вы ищете информацию о старых версиях операционных систем: Windows XP, 2003, 98 или Apache 1.x, обратитесь к разделу руководства Установка на старых версиях ОС Windows.
Официальные релизы PHP для Windows рекомендованы для использования в промышленной эксплуатации. Однако, вы также можете собрать PHP из исходных кодов. Вам потребуется окружение Visual Studio. Обратитесь к разделу » Пошаговое руководство по сборке для получения более полной информации.
Установка PHP на Azure App Services (он же Microsoft Azure, Windows Azure, или (Windows) Azure Web Apps).
User Contributed Notes 12 notes
If you make changes to your PHP.ini file, consider the following.
(I’m running IIS5 on W2K server. I don’t know about 2K3)
PHP will not «take» the changes until the webserver is restarted, and that doesn’t mean through the MMC. Usually folks just reboot. But you can also use the following commands, for a much faster «turnaround». At a command line prompt, type:
and that will stop the webserver service. Then type:
and that will start the webserver service again. MUCH faster than a reboot, and you can check your changes faster as a result with the old:
in your page somewhere.
I wish I could remember where I read this tip; it isn’t anything I came up with.
You can have multiple versions of PHP running on the same Apache server. I have seen many different solutions pointing at achieving this, but most of them required installing additional instances of Apache, redirecting ports/hosts, etc., which was not satisfying for me.
Finally, I have come up with the simplest solution I’ve seen so far, limited to reconfiguring Apache’s httpd.conf.
My goal is to have PHP5 as the default scripting language for .php files in my DocumentRoot (which is in my case d:/htdocs), and PHP4 for specified DocumentRoot subdirectories.
Here it is (Apache’s httpd.conf contents):
—————————
# replace with your PHP4 directory
ScriptAlias /php4/ «c:/usr/php4/»
# replace with your PHP5 directory
ScriptAlias /php5/ «c:/usr/php5/»
AddType application/x-httpd-php .php
Action application/x-httpd-php «/php5/php-cgi.exe»
# populate this for every directory with PHP4 code
Action application/x-httpd-php «/php4/php.exe»
# directory where your PHP4 php.ini file is located at
SetEnv PHPRC «c:/usr/php4»
# remember to put this section below the above
# directory where your PHP5 php.ini file is located at
SetEnv PHPRC «c:/usr/php5»
—————————
This solution is not limited to having only two parallel versions of PHP. You can play with httpd.conf contents to have as many PHP versions configured as you want.
You can also use multiple php.ini configuration files for the same PHP version (but for different DocumentRoot subfolders), which might be useful in some cases.
Remember to put your php.ini files in directories specified in lines «SetEnv PHPRC. «, and make sure that there’s no php.ini files in other directories (such as c:\windows in Windows).
And finally, as you can see, I run PHP in CGI mode. This has its advantages and limitations. If you have to run PHP as Apache module, then. sorry — you have to use other solution (the best advice as always is: Google it!).
Hope this helps someone.
I installed by Microsoft Installer, manually, whatever I always received de same error from IIS7.
HTTP Error 404.3 — Not Found
The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.
The IIS7 interface is quite diferent and are not all together like IIS6
The 5.3 version have not any of those files: php5stdll, php5isapi.dll. etc.
The installer puts others files in handlers and I decided to use them as substitutes. Nothing done!
After that, I discovered that installer do not install these files within the sites, but in the root default site configuration of IIS7.
So, I copied the root configuration to my site and them it worked (all others procedures were done e.g. copy php.ini to windows folder)
PHP 5.2.9.2 Install on XP Pro IIS 5.1 — phpinfo( ) results incorrect
Testing Date: 05.15.09
Background:
For several days now I, as a newbie, have been unsure if I had installed PHP correctly, or not. No matter what I did phpinfo( ) reported «Configuratin File Path» as: “C:\WINDOWS”. I was left to wonder what was wrong.
To help resolve the phpinfo() “issue”, I conducted a series of tests using two scripts:
The first is “test-php-ini-loaded.php”; it is stored in c:\inetpub\wwwroot, and has the following code:
if ( $inipath ) <
echo ‘Loaded php.ini: ‘ . $inipath ;
> else <
echo ‘A php.ini file is not loaded’ ;
>
?>
The second script is simply calls phpinfo( ). It is named test.php, is stored in “c:\inetpub\wwroot”, and has the following code:
( ); ?>
My Dev Environment:
1. Windows XP Pro SP3
2. IIS 5.1 / MMC 3.0
3. PHP 5.2.9.2 – phpMyAdmin not yet installed
4. (plus MySQL 5.1, etc.)
5. Install location is on my local E: drive
Php installer windows installer
Установщик Windows для последних версий PHP построен на технологии MSI с использованием Wix Toolkit (» http://wix.sourceforge.net/). Он установит и сконфигурирует PHP, все встроенные и PECL расшрения, а также сконфигурирует многие популярные веб сервера, такие как IIS , Apache и Xitami.
Обычная установка
Запустите установщик MSI и следуйте инструкциям мастера установки. Вам потребуется выбрать веб сервер, который вы хотите сконфигурировать и необходимые детали конфигурации.
Затем появится запрос на выбор функций и расширений, которые вы хотите установить. Выбирая вариант установки «Will be installed on local hard drive» в выпадающем меню для кадого пункта вы можете выбрать устаналивать ли данную функцию или нет. Выбирая вариант установки «Entire feature will be installed on local hard drive» вы можете установить все подпункты выбранного пункта (например, выбирая эту опцию для «PDO» вы установите все драйверы PDO).
Не рекомендуется устанавливать все расширения по умолчанию, так как многих из них имеют внешние зависимости для функционирования. Вместо этого вы можете воспользоваться функцией «Изменить» из меню «Установка и удаление программ» панели управления для добавления или удаления функций после установки.
Затем установщик настраивает PHP для работы в Windows и файл php.ini и конфигурирует выбранные веб сервера для работы с PHP. На данный момент поддерживаются IIS, Apache, Xitami, и Sambar Server; если вы используете другой веб сервер, вам нужно настроить его вручную.
Тихая установка
Установщик также поддерживает режим тихой установки, который полезен системным администраторам для легкой установки PHP. Для использования этого режима:
Вы можете настроить директорию для установки передав ее как параметр установщику. Например, чтобы установить в e:\php:
Кроме того, можно указать какие функции необходимо установить. Например, чтобы установить расширение mysqli и CGI:
Текущий список функций для установки приведен ниже:
Для дальнейшей информации по установке из MSI установщиков через командную строку посетите » http://msdn.microsoft.com/en-us/library/aa367988.aspx
Обновление PHP с помощью установщика
Для обновления запустите установщик в графическом или консольном режиме. Установщик прочитает текущие настройки установки, удалит старую установку и переустановит PHP с теми же опциями, которые использовались ранее. Рекомендуется использовать этот метод обновления вместо ручной замены файлов в директории установки.
PHP installation on windows
I want to install php in my system.For this I have downloaded the php-5.3.5.tar.bz2 (zip file). Now from this installation help link http://www.php.net/manual/en/install.windows.installer.msi.php It is saying «Run the MSI installer and follow the instructions provided by the installation wizard. «
But i am not getting from where I can get MSI installer?
11 Answers 11
hello bro try this link. you dont need to install others. Just install wamp server and you will be having php,mysql and apache in your server. Download Wamp
Choose the latest PHP x.y.z (Current stable) For IIS, download the non-threadsafe zip file
Extract the downloaded zip file to c:\PHP
Download PHP-Manager for IIS 7 (that’s an IIS-controlpanel-extension, also works for IIS 8) from https://github.com/phpmanager/phpmanager/releases (make sure you choose the right bitness (32 vs. 64)
Open the IIS management console (inetmgr.exe)
Double-click PHP-Manager and click on «register new PHP installation»
(note to self: never remove the PHP directory, otherwise «rien ne va plus»)
Create a new file called hello.php in c:\inetpub\wwroot with this content
10. open cmd.exe and execute «iisreset»