Home >Backend Development >PHP Problem >PHP compilation and installation steps
PHP compilation and installation steps
PHP compilation and installation steps:
First enter the PHP official website and download the PHP source code locally ;
Then upload the PHP source code to the server and decompress the PHP source code;
Decompression command
tar -xjvf
Decompression directory The content inside
#Then install the decompressed PHP source code;
If it prompts that there is any missing software, just directly (centos) yum install or (ubuntu ) apt-get install to install these compilation software. (Generally, if there is something missing, it is gcc, autoconfig and other compilation software)
./configure --prefux=/home/soft/php/ --with-config-file-path=/home/soft/php/etc
Finally, just add PHP to the environment variable.
vim ~/.bash_profile
Add alias = php=/home/soft/php/bin/php
php -v Test whether it works
Recommended tutorial: "PHP"
The above is the detailed content of PHP compilation and installation steps. For more information, please follow other related articles on the PHP Chinese website!