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

How to compile and install PHP

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article will explain in detail how to compile and install PHP. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

PHP compilation and installation

# cd / usr/local/src

# wget http://cn2.php.net/distributions/php-5.5.26.tar.bz2

# tar jxvf php-5.5.26.tar.bz2

# cd php-5.5.26

#. / configure\

-- prefix=/usr/local/php\ # # specify the installation directory

-- with-apxs2=/usr/local/apache2/bin/apxs\ # automatically installs the "dynamic" extension module

-- with-config-file-path=/usr/local/php/etc\

-- with-mysql=/usr/local/mysql\ # # indicates that php also depends on mysql

# # also explain why you must install mysql or apache before installing php

-- with-libxml-dir\

-- with-gd\

-- with-jpeg-dir\

-- with-png-dir\

-- with-freetype-dir\

-- with-iconv-dir\

-- with-zlib-dir\

-- with-bz2\

-- with-openssl\

-- with-mcrypt\

-- enable-soap\

-- enable-gd-native-ttf\

-- enable-mbstring\

-- enable-sockets\

-- enable-exif\

-- disable-ipv6

# # in the process of compilation and installation, many errors will occur because PHP depends on some packages

# # examples of errors:

# # when "configure:error:jpeglib.h not found" or "configure:error:mcrypt.h.h not found" appears

# # install epel extension Source (yum extension Source) first:

# rpm-ivh 'http://www.lishiming.net/data/p_w_upload/forum/epel-release-6-8_32.noarch.rpm'

# # you can find the corresponding package in the source:

# yum list | grep-I jpeg or yum list | grep-I mcrypt

# # A file named "libjpeg-turbo-devel" or "libmcrypt-devel" corresponding to these two errors

# # install the package

# yum install-y libjpeg-turbo-devel or

# yum install-y libmcrypt-devel

# # recompile and install php after installing the package.

# echo $?

# make

# echo $?

# make install

# echo $?

Common options for ★ PHP

# / usr/local/php/bin/php # # executable file

# / usr/local/php/bin/php-m # # you can see some static modules

# # php also has dynamic modules, which need to be compiled by yourself

# / usr/local/php/bin/php-I # # you can view relevant configurations (version information, etc.)

This is the end of this article on "how to compile and install PHP". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

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

Development

Wechat

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

12
Report