Home Backend Development PHP Problem php5.3 installation tutorial

php5.3 installation tutorial

Sep 12, 2021 am 09:19 AM

php5.3 installation method: 1. Install through sudo apt-get; 2. Compile and install; 3. Configure php-fpm; 4. Install memcached and other extensions.

php5.3 installation tutorial

The operating environment of this article: centOS6.8 system, php5.3 version, DELL G3 computer

php5.3 installation tutorial

php5.3 installation

sudo apt-get install gcc
sudo apt-get install g++
sudo apt-get install autoconf
sudo apt-get install libxml2
sudo apt-get install libxml2-dev
sudo apt-get install libevent-1.4-2
sudo apt-get install libevent-dev
sudo apt-get install bzip2
sudo apt-get install libbz2-dev
sudo apt-get install libcurl3-gnutls
sudo apt-get install libcurl4-gnutls-dev
sudo apt-get install libpng12-0
sudo apt-get install libpng12-dev
sudo apt-get install libjpeg62
sudo apt-get install libjpeg62-dev
sudo apt-get install libfreetype6
sudo apt-get install libfreetype6-dev
sudo apt-get install libmcrypt4
sudo apt-get install libmcrypt-dev
sudo apt-get install zlib1g-dev
sudo apt-get install libtidy-dev
Copy after login

sudo apt-get install autoconf g++ libxml2-dev libevent-dev libbz2-dev libcurl4-gnutls-dev libpng12-dev libjpeg62-dev libfreetype6-dev libmcrypt-dev zlib1g-dev
./configure  --prefix=/usr/local/php55 --with-gettext --with-mysql=mysqlnd --with-gd --with-jpeg-dir --with-png-dir --with-curl --with-freetype-dir --enable-gd-native-ttf --enable-mbstring --enable-sockets --with-mcrypt --with-pdo-mysql=mysqlnd --enable-fpm --with-zlib --enable-zip --with-bz2 --enable-bcmath --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-pcntl
Copy after login

Note:

If it is RH, you need:

yum -y install curl-devel
yum install libjpeg-devel
yum install libpng-devel
yum install freetype-devel
yum install -y libmcrypt-devel.x86_64 
 
yum install -y libxml2-devel.x86_64
yum install -y bzip2-devel.x86_64 
 
yum install libtool-ltdl-devel (在 make的时候会出现:/usr/bin/ld: cannot find -lltdl)
yum install autoconf 
yum install -y libtidy-devel.x86_64
Copy after login

Compilation and installation

./configure  --prefix=/usr/local/php-5.3.3 --with-gettext --with-mysql=mysqlnd --with-gd --with-jpeg-dir --with-png-dir --with-curl --with-freetype-dir --enable-gd-native-ttf --enable-mbstring --enable-sockets --with-mcrypt --with-pdo-mysql=mysqlnd --enable-fpm --with-zlib --enable-zip --with-bz2 --enable-bcmath --with-tidy
 make
 make install
Copy after login

After the compilation and installation are completed, php-fpm still needs to be configured, because php5.3 no longer requires the php-fpm patch, so the previous control of php -The method of fpm (start, restart) needs to be changed. The steps are as follows:

Copy from the source package:

sudo path/to/php-source/folder/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
sudo chmod a+x /etx/init.d/php-fpm
Copy after login

Then you can do it through /etc/init.d/php-fpm (start|stop|force-quit|restart|reload) Control

General extension installation

memcached:

wget http://pecl.php.net/get/memcache-2.2.5.tgz
tar -xvf memcache-2.2.5.tgz
cd memcache-2.2.5
/usr/local/php-5.3.3/bin/phpize
./configure --with-php-config=/usr/local/php-5.3.3/bin/php-config
make
make install
Copy after login

solr

wget http://pecl.php.net/get/solr-0.9.11.tgz
tar -xvf solr-0.9.11.tgz
cd solr-0.9.11
/usr/local/php-5.3.3/bin/phpize
./configure --with-php-config=/usr/local/php-5.3.3/bin/php-config
make
make install
Copy after login

xcache

 wget http://xcache.lighttpd.net/pub/Releases/1.3.0/xcache-1.3.0.tar.bz2
 tar -xjvf xcache-1.3.0.tar.bz2
 cd xcache-1.3.0
 /usr/local/php-5.3.3/bin/phpize
 ./configure --with-php-config=/usr/local/php-5.3.3/bin/php-config
 make
 make install
Copy after login
 php_ini
Copy after login
expose_php = off
error_reporting = E_ALL
display_errors = On
short_open_tag = On
 
extension=memcache.so
extension=xcache.so
extension=solr.so bbs需要
 
;log_errors = on
error_log = syslog linux系统可以使用这个,把errorlog 输出到syslog中
date.timezone = Asia/Shanghai
Copy after login

Recommended study: "PHP Video Tutorial"

The above is the detailed content of php5.3 installation tutorial. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP 8 JIT (Just-In-Time) Compilation: How it improves performance. PHP 8 JIT (Just-In-Time) Compilation: How it improves performance. Mar 25, 2025 am 10:37 AM

PHP 8's JIT compilation enhances performance by compiling frequently executed code into machine code, benefiting applications with heavy computations and reducing execution times.

OWASP Top 10 PHP: Describe and mitigate common vulnerabilities. OWASP Top 10 PHP: Describe and mitigate common vulnerabilities. Mar 26, 2025 pm 04:13 PM

The article discusses OWASP Top 10 vulnerabilities in PHP and mitigation strategies. Key issues include injection, broken authentication, and XSS, with recommended tools for monitoring and securing PHP applications.

PHP Secure File Uploads: Preventing file-related vulnerabilities. PHP Secure File Uploads: Preventing file-related vulnerabilities. Mar 26, 2025 pm 04:18 PM

The article discusses securing PHP file uploads to prevent vulnerabilities like code injection. It focuses on file type validation, secure storage, and error handling to enhance application security.

PHP Encryption: Symmetric vs. asymmetric encryption. PHP Encryption: Symmetric vs. asymmetric encryption. Mar 25, 2025 pm 03:12 PM

The article discusses symmetric and asymmetric encryption in PHP, comparing their suitability, performance, and security differences. Symmetric encryption is faster and suited for bulk data, while asymmetric is used for secure key exchange.

PHP Authentication & Authorization: Secure implementation. PHP Authentication & Authorization: Secure implementation. Mar 25, 2025 pm 03:06 PM

The article discusses implementing robust authentication and authorization in PHP to prevent unauthorized access, detailing best practices and recommending security-enhancing tools.

PHP CSRF Protection: How to prevent CSRF attacks. PHP CSRF Protection: How to prevent CSRF attacks. Mar 25, 2025 pm 03:05 PM

The article discusses strategies to prevent CSRF attacks in PHP, including using CSRF tokens, Same-Site cookies, and proper session management.

PHP API Rate Limiting: Implementation strategies. PHP API Rate Limiting: Implementation strategies. Mar 26, 2025 pm 04:16 PM

The article discusses strategies for implementing API rate limiting in PHP, including algorithms like Token Bucket and Leaky Bucket, and using libraries like symfony/rate-limiter. It also covers monitoring, dynamically adjusting rate limits, and hand

PHP Input Validation: Best practices. PHP Input Validation: Best practices. Mar 26, 2025 pm 04:17 PM

Article discusses best practices for PHP input validation to enhance security, focusing on techniques like using built-in functions, whitelist approach, and server-side validation.

See all articles