Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is CentOS PHP installation and compilation

2025-04-12 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

What is CentOS PHP installation and compilation, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.

The characteristics of CentOS PHP installation system can be used not only as the study of CentOS PHP installation for computer majors in colleges and universities, but also for CentOS system open source enthusiasts and Linux system users. The Linux distribution of the CentOS community is called CentOS Linux. Due to the use of recompiling the source code of RHEL to generate a new distribution, CentOS Linux has very good compatibility with RHEL products and is born with many of the excellent features of RHEL.

CentOS PHP installation

1. Download: php4.3.11

[root@localhost ~] # cd / usr/local/src/

[root@localhost src] #

Http://ftp.gamearena.cn/software/php-4.3.11.tar.gz

[root@localhost src] # chmod + x php-4.3.11.tar.gz

[root@localhost src] # tar-zxvf php-4.3.11.tar.gz

2. CentOS PHP installation sets compiler parameters

[root@localhost src] # cd php-4.3.11

[root@localhost src] #. / configure prefix=/usr/local/php4 with-mysql=/usr/local/mysql with-apxs2=/usr/local/apache2/bin/apxs with-config-file-path=/usr/local/php4 with-gd with-jpeg-dir with-png with-ttf with-zlib enable-mbstring enable-ftp with-freetype-dir with-xml disable-debug enable-inline-optimization-Q enable-thread-safety

# Parameter Notes:

With-mysql=/usr/local/mysql

Specify the location where mysql is installed

With-apxs2=/usr/local/apache2/bin/apxs

Compile the shared Apache 2.0 module. FILE is the path to the optional Apache apxs tool, which defaults to apxs

With-config-file-path=/usr/local/php4

Set the path where php.ini is located. Default is PREFIX/lib.

With-gd

Specify gd

With-jpeg-dir

With-png

With-ttf

With-zlib

Enable-mbstring

Enable-ftp

Turn on ftp support

With-freetype-dir

With-xml

Disable-debug

Disable debugging symbols

Enable-inline-optimization

Enable-thread-safety

3. CentOS PHP installation and compilation

[root@localhost php-4.3.11] # make; make install

4. Dump the basic configuration file of CentOS PHP installation

[root@localhost php-4.3.11] # cp php.ini-dist / usr/local/php4/php.ini

# this path must be consistent with the with-config-file-path setting in. / configure

5. Integrate apache and CentOS PHP

[root@localhost php-4.3.11] # vi / usr/local/apache2/conf/httpd.conf

Plus:

AddType application/x-httpd-php .php

Find, add index.php after DirectoryIndex on the following line, for example:

DirectoryIndex index.php index.html

PS: in fact, the setting of "enable default content document" in this DirectoryIndex and IIS has the same meaning, so you should know what it is for.

6. Restart apache

[root@localhost php-4.3.11] # / usr/local/apache2/bin/apachectl stop

[root@localhost php-4.3.11] # / usr/local/apache2/bin/apachectl start

Remember: do not directly use [root@localhost php-4.3.11] # / usr/local/apache2/bin/apachectl restart. When I configured it *, this operation caused the apache service to fail to start, which made me check it for a long time.

7. Test whether the CentOS PHP installation is working properly

[root@localhost php-4.3.11] # echo'> / usr/local/apache2/htdocs/phpinfo.php

# enter http:// your address / phpinfo.php in the browser, and if the following screen appears, it means that PHP has been compiled successfully.

Install Zend Optimizer

1. Download: Zend Optimizer 3.2.2

[root@localhost ~] # cd / usr/local/src/

[root@localhost src] # wget

Http://downloads.zend.com/optimizer/3.2.2/ZendOptimizer-3.2.2-linux-glibc21-i386.tar.gz

[root@localhost src] # chmod + x ZendOptimizer-3.2.2-linux-glibc21-i386.tar.gz

[root@localhost src] # tar-zcvf ZendOptimizer-3.2.2-linux-glibc21-i386.tar.gz

2. Install Zend Optimizer

[root@localhost src] # cd / usr/local/src/ZendOptimizer-3.2.2-linux-glibc21-i386

[root@localhost ZendOptimizer-3.2.2-linux-glibc21-i386] #. / install.sh

# enter all the way according to the installation prompts, only pay attention to select the php.ini directory, and you need to change it to the directory where your php.ini is actually located. Since we specified with-config-file-path=/usr/local/php4 when we compiled and installed php earlier, we changed the default / etc to / usr/local/php4. As shown in the figure:

3. Check whether Zend Optimizer is installed successfully through the php probe file.

If normal, you should be able to see the message of successful installation of Zend Optimizer. The red box in the picture

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report