- Php installer windows installer
- Для предварительного просмотра страниц с кодом PHP необходим тестовый сервер.
- php Установка PHP в системах Windows.
- Установка PHP в современных операционных системах Microsoft Windows и рекомендуемая конфигурация для распространенных веб-серверов.
- Скачать PHP.
- Не удалось открыть этот пакет установки.
- Сервер Apache 2 PHP 5 Редактирование файла конфигурации Apache — httpd.conf для работы PHP на Windows
- PHP: Изменения в файле — php.ini
- Установка в системах Windows
- Содержание
- User Contributed Notes 12 notes
Php installer windows installer
установка PHP на вашем ПК позволяет безопасно создавать и тестировать веб-приложение, не затрагивая данные или системы на вашем веб-сайте.
Для предварительного просмотра страниц с кодом PHP необходим тестовый сервер.
Во-первых, установите HTTP сервер Apache на вашей системе, и удостоверьтесь, что он работает.
Устанавить веб-сервер Apache с поддержкой PHP на операционной системе Windows не сложно.
Используйте сборки Apache, предоставляемые Apache Lounge.
php Установка PHP в системах Windows.
Установка PHP в современных операционных системах Microsoft Windows и рекомендуемая конфигурация для распространенных веб-серверов.
Скачать PHP.
Зайдите на страницу загрузки официального сайта — PHP Archives
Выберите сборку
Есть 2 типа сборок PHP:
- Thread-Safe(TS) — для одного процесса веб-служб, как Apache с mod_php
- Non-Thread-Safe(NTS) — для служб IIS и других FastCGI веб-серверов (Apache с mod_fastcgi) рекомендуется и для сценариев командной строки
Загрузите Thread Safe, если вам нужно запустить PHP в качестве модуля.
Можно установить PHP как модуль, но лучше устанавливать PHP поверх mod_fcgid (fastcgi, best practice)
Программы инсталляции PHP 5 доступны только для 32-разрядных версий Windows, поэтому установка PHP как модуля возможна только на 32-разрядные версии Apache, например — apache_2.2.24-x86-no-ssl.msi.
Не удалось открыть этот пакет установки.
Убедитесь, что пакет существует и у вас есть к нему доступ, или обратитесь к поставщику приложения, чтобы проверить правильность этого пакета установщика.
Такое сообщение появится, если программа инсталляции PHP 5 будет запущена не из корневого каталога диска
После нажатия на кнопку Start
или ввода команд:
cd C:\Program Files\Apache Software Foundation\Apache2.4\bin\
httpd -k start
Будет получено сообщение об ошибке:
Администратор: Командная строка
Строка — \xed\xe5 \xff\xe2\xeb\xff\xe5\xf2\xf1\xff \xef\xf0\xe8\xeb\xee\xe6\xe5\xed\xe8\xe5\xec Win32.
переводится как: не является приложением Win32
Для установки PHP 5 из установочного пакета запустите ( обязательно из корневого каталога диска ) программу инсталляции.
Процедура инсталляции
PHP в ОС Windows полностью автоматизирована.
Запустите, из корневого каталога диска C:\,
программу инсталляции — php-5.3.9-Win32-VC9-x86.msi.
Открыть файл — предупреждение системы безопасности и нажмите — Запустить
В окне — PHP 5.3.9
нажмите кнопку Next.
Прочитайте лицензию и отметьте пункт —
I accept the terms in license agreement
(Я принимаю условия лицензионного соглашения).
Согласитесь с установкой PHP 5 в каталог по умолчанию — C:/Program Files(x86)/PHP/
Нажмите на кнопку Browse,
укажите путь к каталогу, в котором находятся файлы конфигурации сервера Apache —
C:\Program Files\Apache Software Foundation\Apache2.2\conf\
то в середине установки PHP 5
Будет выведено сообщение об ошибке —
«Error trying access httpd.conf file. You will need to manyally conigure the web server».
Ошибка при попытке доступа к файлу httpd.conf. Вам нужно будет вручную настроить веб-сервер
После выбора каталога с конфигурационными файлами сервера Apache
продолжите установку PHP
Installs PHP with all server modules and extensions enabled.
It is recommended to only select the extensions and modules you need below.
Устанавливает PHP с включенными всеми модулями сервера и расширениями.
Рекомендуется выбирать только те расширения и модули, которые вам нужны.
Оставьте установки по умолчанию.
Имеющим определенный опыт, можно сразу установить необходимые модули, нажимая на стрелку выбранного расширения и выделяя пункт- Will be installed on local hard drive (установить на локальный жесткий диск), для добавления необходимого расширения.
Запустите процесс инсталляции PHP
Дождитесь окончания установки PHP
Для завершения процесса инсталляции — нажмите на кнопку Finish.
Сервер Apache 2 PHP 5
Редактирование файла конфигурации Apache — httpd.conf для работы PHP на Windows
Если у вас был установлен сервер Apache 2, то программой установки PHP 5, после блока — #
В конце файла — httpd.conf
(C:/Program Files/Apache Software Foundation/Apache2.4/conf/)
будут добавлены ( выделено красным ) следующие записи:
Файл httpd.conf
После окончания инсталляции в меню — Пуск — Все программы, будет создан новый пункт — PHP 5
После перезагрузки компьютера или перезапуска сервера Apache
К службе Apache/2.2 (Win32) будет добавлена запись — PHP/5.3.9.
Убедитесь, что вы можете запустить PHP из командной строки Windows
введя — cd c:\Program Files (x86)\PHP\ и, затем — php -v
Администратор: Командная строка
Список загруженных модулей — php -m
Администратор: Командная строка
PHP: Изменения в файле — php.ini
Включить расширения. Это будет зависеть от библиотек, которые вы хотите использовать, но следующие расширения должны быть пригодны для большинства приложений (удалите комментарий с запятой):
По мере приобретения опыта, вы в любой момент можете добавить необходимые модули из панели управления —
Пуск — Панель управления — Установка и удаление программ — Программы и компоненты,
нажав кнопку — Изменить.
Будет запущена программа инсталляции.
Дойдите до окна диалога — Change, repair, or remote installation и нажмите кнопку Change.
В диалоге — Choose Item to Install, выберите нужный модуль, нажмите на стрелку
и на пункт — Will be installed on local hard drive (установить на локальный жесткий диск),
для добавления необходимого расширения.
Установка в системах 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:
net start w3svc
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.
If you are installing PHP on Vista just go to David Wang’s blog. http://blogs.msdn.com/david.wang/
archive/2006/06/21/HOWTO-Install-and-Run-PHP-on-IIS7-Part-2.aspx
I made the mistake of setting a ‘wildcard application map’ for PHP on a Windows 2003 / IIS 6.0 / PHP ISAPI installation.
This resulted in «No input file specified» errors whenever I tried to load the default page in my site’s directories. I don’t know why this broke things, but it did.
If anyone has the same problem, this may be the cause.
IIS setup: 403 forbidden error.
We had installed two separate different PHP versions — PHP 5.1.4 followed by 5.2.5.
We configured 5.2.5 php5isapi.dll to be loaded as the .php file type extension.
Despite this, php version 5.1.4 was being loaded. We renamed 5.1.4’s folder and then PHP was not loading at all.
There were no visible references to 5.1.4 in the IIS configuration, but in the file \webConfig.xml, there was a reference to 5.1.4’s isapi under IISFilters.
To fix this problem, we added version 5.2.5’s php5isapi.dll to the ISAPI Filter category for the web site, in the IIS control panel.
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)
If you get 404 page not found on Windows/IIS5, have a look at C:\SYSTEM32\INETSRV\URLSCAN
There is a .ini file there that prevents some files from being served by IIS, even if they exist, instead IIS will give a 404. The urlscan logfile (same place) should give you some insight into what parameter is preventing a page from loading, if any.
Here’s how to run dual PHP instances with PHP 5.2 and any previous PHP on Windows 2003:
1. Right-click My Computer, go to Advanced tab, and click on Environment Variables.
Add the two installations and their EXT directories to the Path variable. For example, add:
c:\php;c:\php\ext;c:\TMAS\php;c:\tmas\php\ext;
Then, add the newer PHP version’s directory as a variable called PHPRC. For example:
Variable:PHPRC
Value: C:\PHP
Click OK to close the Environment Variables window, and click OK to close System Properties.
2. In registry, under HKEY_LOCAL_MACHINE>SOFTWARE>PHP, add a REG_SZ key called iniFilePath and give it a value
of the directory where the older PHP is installed. For example:
C:\TMAS\PHP
3. In IIS, go to the Web Service Extensions. Add both versions’ ISAPI module separately to the extensions
list, and allow both.
4. In IIS, go to each website utilizing the PHP versions. Set an ISAPI filter if needed. On the Home Directory
tab, click Configuration, and add .php, .php3, .phtml, and any other extensions needed (perhaps .html?) to
be filtered through PHP, and specify the ISAPI module version needed for each website.
You can now run two versions of PHP. This is because the order of where to look for the .ini file changed
between previous PHP versions and PHP 5.2, as documented at http://us2.php.net/ini:
* SAPI module specific location (PHPIniDir directive in Apache 2, -c command line option in CGI and CLI, php_ini parameter in NSAPI, PHP_INI_PATH environment variable in THTTPD)
* The PHPRC environment variable. Before PHP 5.2.0 this was checked after the registry key mentioned below.
* HKEY_LOCAL_MACHINE\SOFTWARE\PHP\IniFilePath (Windows Registry location)
* Current working directory (for CLI)
* The web server’s directory (for SAPI modules), or directory of PHP (otherwise in Windows)
* Windows directory (C:\windows or C:\winnt) (for Windows), or —with-config-file-path compile time option
—————————————————-
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