Installing PHP as Apache DSO PHP is often used in conjunction with Apache Web servers for Linux/unix platforms. When we install PHP in the Apache environment, you have three installation modes to choose from: Static modules, dynamic modules (DSO), and CGI. I suggest you better install PHP as apached DSO, this installation mode maintenance and upgrade are quite simple. Suppose, for example, that you have only installed PHP's database support functionality. But after a few days, you decided to add encryption to PHP. It's simple, you just type the make clean command, then add new configuration options, and then execute the make and make install commands. This way, the new PHP module will be installed in the appropriate location on Apache, you just restart Apache all OK, of course, the whole process does not have to recompile Apache. The simple steps to install a new version of Apache and install PHP as Apache DSO are as follows: 1. Download the latest version of the Apache Server Software source code from the Apache Software Foundation site. 2. Place the code file in a suitable directory such as/usr/local/or/opt/. 3. Unzip the code file with the Gunzip command, then you can get the corresponding *.tar file. 4. Type the following unpacking command to place the above tar file in the directory with the form Apache_[version]: TAR-XVF Apache_[version].tar 5. Into the/usr/local/apache_[version] directory (or the directory you specified in the previous step). 6. Type the following configuration command, using the path you set (such as/usr/local/apache[version], and so on, note that the trailing slash! ) instead of the [path] parameter, you also enable the MOD_SO parameter to allow Apache to use DSO:/configure--prefix=[path]--enable-module=so 7. Go back to the command prompt and type the make command and wait for the command to complete again to return to the command prompt. 8. Type make install. By this time, the compiler can create the final directory and return to the system's command prompt state. Next, install Php:1. Visit the download area of the PHP home page to check the latest version of the source code link. 2. Place the downloaded file in an appropriate directory such as/usr/local/or/opt/. 3. Unzip the code file with the Gunzip command, then you can get the corresponding *.tar file. 4. Type the followingUnpack command to place the above tar file in a directory of Shape Php-[version]: TAR-XVF php-[version] 5. Into the/usr/local/php-[version] directory (or the directory you specified). Now you can compile the PHP DSO, in fact, there is only a necessary configuration option--with-apxs (a file in the Apache Bin directory)--however, in order to more comprehensive system configuration, we also added to the MySQL database support./configure-- With-mysql=/[path to MySQL]--with-apxs=/[path to APXS] 6. Go back to the command prompt and type the make command and wait until the command completes again to return to the command prompt. 7. Type the make install command. At this time, the compiler will create the final DSO, and put it in the Apache module directory, but also for you to modify the Apache httpd.conf configuration file, then the system back to the command prompt state to wait for you to enter new instructions. You can then open Apache's httpd.conf configuration file to make some corrections: 1. Find a line with the ServerAdmin typeface and add your own email address as follows: ServerAdmin you@yourdomain.com 2. Find a line starting with ServerName, and modify the following parameters to the actual values, such as: ServerName localhost 3. Find the following paragraph: # and for PHP 4.x, use: # #AddType application/x-httpd-php. php #AddType application/x-httpd-php-source. Phps Modify These Configure the line to cancel some of the comments in PHP 4.0 that precede AddType, and you should add some of the file extensions that are used for PHP, and the modified lines may look like this: # and for PHP 4.x, use: # AddType application/x-httpd-php. php. phtml addtype application/x-httpd-php-source. Phps Save the above configuration file, go back to the parent directory, and type the following command to launch Apache:. /bin/apachectl start If no problem occurs during startup, you can test Apache and PHPTo create a file named Phpinfo.php that contains the following lines of code: Save the file and place it in the Apache document root (htdocs), then launch your Web browser, type http://localhost/phpinfo.php in the browser address bar, and the browser will display the various variables and variable values for PHP and Apache system in a large space. If you want to reset PHP, all you have to do is execute the make clean command, then execute the./configure command with the new configuration option, then execute make and make install. In this way, a new module appears in the Apache module directory, and you simply reboot Apache to load the new module. Many of the headache problems of the past are now solved.
http://www.bkjia.com/PHPjc/531799.html www.bkjia.com true http://www.bkjia.com/PHPjc/531799.html techarticle installing PHP as Apache DSO PHP is often used in conjunction with Apache Web servers for Linux/unix platforms. When we install PHP in the Apache environment, you have three kinds of installation modes to choose from: Static ...