Home >Backend Development >PHP Problem >How to install php using linux commands
How to install php using linux command: First download the php installation source package from the official website of php; then execute the command "./configure --prefix=/usr/local/servers/php" to configure the installation environment; Then execute the compilation command in the decompression directory; finally execute the installation command.
linux system installation php
[Download php source code]: Download the php installation source code from the official website of php Bag.
Recommended: "PHP Tutorial"
[Unzip the installation package]: The downloaded installation package is in compressed gz format. In Linux, you can use the built-in tool tar to decompress, and execute the command in the directory where the installation package is located: tar -zxvf php-5.5.11.tar.gz
[Configuration installation Variables]: Open the decompressed directory - execute the command: cd php-5.5.11; configure the installation environment - execute the command: ./configure --prefix=/usr/local/servers/php, "/usr/local/servers/ php" is the installation path, you can change it to your favorite installation path.
[Compile source code]: Execute the compilation command in the decompression directory: make
[Install php]: Switch to Root user - execute command: sudo su root; installation - execute command: make install
Create soft link: execute command: ln -s /usr/local/servers/php/bin/php /usr/local/ bin/php
The above is the detailed content of How to install php using linux commands. For more information, please follow other related articles on the PHP Chinese website!