PHP swoole Extension Installation method detailed tutorial, Phpswoole installation method
Swoole supports PHP 5.3.10 or later, so install swoole before installing PHP 5.3.10 or later, now to introduce the PHP installation configuration method under Windows.
software version:php-5.3.1-win32-vc6-x86.zip
This does not require additional libraries to install. NET, so use this. You can use the other.
1.PHP Installation
Use the green mode to download the zip file to unzip.
2. Configuration
Locate php.ini-development under the root of the decompression, which is the configuration file for the development environment, and a php.ini-production, which is a configuration file for the production environment. Using Php.in-development, copy one and rename to PHP.ini. Start editing.
Positioning registe_globals =off;
It is recommended not to open, the difference is that this value is used to open the global variables, such as the value of the form sent over, if the value is set to "Off", you can only use "$_post[' variable name '", $_get[' variable name '] "and so on to get the value sent, if set to" on ", you can directly use Variable name "To get the value sent over, of course, set to" Off "is more secure, it will not make it easy to transfer data between the page interception. Does this value change to "on" to see oneself feel, is safety important or convenience important?
In order for PHP to be able to invoke other modules, you can search with the extension keyword, navigate to the following, and remove the semicolon before the option to turn on support for this module.
The more modules you load, the more resources you need to use, and the more you can ignore. For example, to enable MySQL support, find the following
; Extension=php_mysql.dll
Remove the front ";" The comment will be all right.
All modules are placed in the Ext directory of the PHP decompression directory and can be enabled as needed.
Loading module Error:
Sometimes when you start Apache, you will be prompted with the error "Unable to find the specified module" Because you do not specify the location of these module files, locate the keyword "Extension_dir", and modify the directory for your PHP module under Windows.
For example, if my PHP directory is D:\PHP, configure
Extession_dir = "D:\PHP\ext"
In this way, Apache will not be error-activated.
Here is the simplest way to directly specify the PHP installation path, the EXT path inside the Windows system path-right-click on "My Computer", "Properties", select "Advanced" tab, click "Environment Variables", under "system variables" to find "path" variable, select, double click or tap "Edit", add ";D: \php;d:\php\ext" to the original value, of course, where the "D:\php" is my installation directory, you want to change it to your own PHP installation directory, as shown, all OK.
3. Working together with Apache
PHP in the form of a module with Apache, open Apache configuration file, the keyword "LoadModule" location, configure the module to be loaded,
Add the following two lines at the end:
LoadModule Php5_module D:/php/php5apache2_2.dll
Phpinidir "d:/php"
The first line "LoadModule php5_module D:/php/php5apache2_2.dll" refers to loading PHP in module mode, the second line "Phpinidir" d:/php "" is to indicate the location of the PHP configuration file php.ini, of course, where the "d:/php" is changed to your previously selected PHP decompression directory.
There are Php5apache2.dll and Php5apache2_2.dll in the PHP extract directory, because our Apache version is 2.2, so load DLL
With Php5apache2_2.dll, you can configure it according to your own situation.
With the keyword AddType application search, you can define the type of PHP file that can be executed,
The original text is as follows: AddType allows you to add to or override the MIME configuration
# file specified in Typesconfig for specific file types.
Join
AddType application/x-httpd-php. php
Addtypeapplication/x-httpd-php.html
Two lines, you can also add more, in essence is the file type can be executed PHP, such as you added a line "addtypeapplication/x-httpd-php. htm", the. htm file can also execute PHP program, you can even add a line " addtypeapplication/x-httpd-php. txt ", so that normal text txt can also run PHP programs.
The basic configuration of PHP is complete.
Continue with the PHP swoole extension installation Method Introduction:
Put PHP into environment variables after installation is complete
# export Path=/usr/local/php/bin: $PATH # export Path=/usr/local/php/sbin: $PATH
After saving, the Terminal input command:
# source ~/.BASHRC
You can then install the swoole extension. Please go to swoole extension download address to download the latest stable version, this article takes 1.8.5 as an example:
# wget https://github.com/swoole/swoole-src/archive/swoole-1.8.5-stable.tar.gz# Tar zxvf swoole-1.8.5-stable.tar.gz # CD swoole-1.8.5-stable# phpize #./configure # make && make install
Then add the swoole extension to the php.ini file:
Extension=swoole.so
Restart PHP-FPM:
# Service PHP-FPM Restart
Then look at the extended installation situation. If you see Swoole in the extensions listed, the installation is successful:
Php-m
The above is the whole content of this article, I hope that you learn PHP programming help.
http://www.bkjia.com/PHPjc/1127848.html www.bkjia.com true http://www.bkjia.com/PHPjc/1127848.html techarticle PHP Swoole Extended Installation Method detailed tutorial, Phpswoole installation method Swoole support PHP 5.3.10 above, so install the swoole before installing PHP 5.3.10 or later, now to introduce ...