In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces how to install php environment under windows, with certain reference value, interested friends can refer to, I hope you have a lot of harvest after reading this article, let Xiaobian take you to understand.
Installation method: 1. Install and configure Apache;2. Download and extract the php installation package to the specified path;3. Copy a copy of "php.ini-development" and rename it "php.ini" and place it under the installation path to configure the file;4. Load PHP in Apache and define the file that executes the PHP module.
Operating environment of this tutorial: Windows 7 system, PHP 7.1 version, DELL G3 computer
Install PHP Development Environment under Windows
I. Apache
Because Apache official website only provides source code, if you want to use it you must compile it yourself, here I choose the third-party installation package Apache Lounge.
Enter Apachellounge official download address: www.apachelounge.com/download/
First download and install vc redist, a component required for Apache to run.
Download the unzipped version of Apache and place the unzipped folder in the path you want to install.
Modify configuration files:
Apache default exists under path: c:\Apache24 (version numbers may vary). If the installation path is different from yours, you need to open the Apache\conf\httpd.conf configuration file and change all c:\Apache24, c: \Apache24\httdocs, and c:\Apache24\cgi-bin\that are not preceded by a "#" comment to the corresponding path.
Specify IP and port: Find ServerName www.example.com:80 at httpd.conf, remove the previous comment, and change "www.example.com" to "localhost." If you want to modify the port, modify "80" here along with 80 in "Listen: 80" above.
(Optional) Add a system variable: Add "Apache installation path\bin" to Path.
Verify that the installation was successful: Run Apache's startup httpd.exe. Type localhost:80 in your browser, and Apache configuration is complete if it is not inaccessible.
Tips: Registering Apache as a Windows Service
Install: apache in the bin directory under administrator privileges
httpd.exe -k install
Uninstall: Execute with administrator privileges in apache's bin directory
httpd.exe -k uninstall
II. PHP
Install Configuration PHP
Enter PHP download address http://windows.php.net/download to download the latest thread-safe version of PHP zip package, unzip it and put it under the path you want to install.
Note: The downloaded VC version of PHP cannot be higher than the VC redist version previously installed.
Enter the PHP installation directory, copy a copy of php.ini-development and rename it php.ini to the installation path, open it and find;extension_dir=ext, remove the comment character, and change the value to PHP installation path\ext.
extension_dir = "D:/Program Files/php-7.2.10/ext"
Loading PHP in Apache & defining files that execute PHP modules
Open the Apache configuration file conf\httpd.conf, find the LoadModule field, and add:
LoadModule php7_module "PHP installation path\php7apache2_4.dll" #Load PHP as a module in Apache, the "7" in "php7_module" corresponds to the version of PHP; in addition, different PHP versions "php7apache2_4.dll" may vary.
PHPINIDir "PHP installation path" #Tell Apache PHP installation path
#Load PHP as a module in Apache, the "7" in "php7_module" corresponds to the PHP version; in addition, different PHP versions "php7apache2_4.dll" may be different. #php 7.2.10 LoadModule php7_module 'D:/Program Files/php-7.2.10/php7apache2_4.dll' #Tell Apache PHP installation path PHPIniDir 'D:/Program Files/php-7.2.10/php.ini' # define php module file .php and.html files can execute PHP programs AddType application/x-httpd-php .php .html #AddType application/x-httpd-php-source .phps
Test: Create a new file under Apache installation path\htdocs: test.php, edit it: , start Apache, and enter localhost: 80/test.php in the browser.
Thank you for reading this article carefully, I hope Xiaobian shared "How to install php environment under windows" This article is helpful to everyone, but also hope that everyone will support more, pay attention to the industry information channel, more relevant knowledge waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.