Install the php environment in Linux and the linuxphp Environment

Source: Internet
Author: User

Install the php environment in Linux and the linuxphp Environment

1. Use screen (optional)
It takes a long time to compile and install Nginx, Apache, PHP, MySQL, and other software. It is inevitable that the installation may be interrupted due to unexpected network interruptions. To avoid this problem, you can use screen for installation.
Screen is used as follows:
1. Install screen
Ubuntu/debian system:

apt-get install -y screen

Centos/redhat system:

yum install -y screen

2. Create a screen session
Command:

screen -S ezhttp

After you run this command, a new window is created, and you can continue the second installation in this window.
3. SSH disconnection recovery
If you have already executed Step 1 and then run the ezhttp installer, during the installation process, ssh is suddenly interrupted due to network or other reasons, you can reconnect to ssh, run the following command to restore the previous window:

screen -r ezhttp

Ii. install required tools
Execute the ezhttp installation program. At least unzip and wget tools are required.
Ubuntu/debian system:

apt-get install wget unzip

Centos/redhat system:

yum install -y wget unzip

3. download and execute EZHTTP
Method 1 (recommended, git installation required ):

git clone https://github.com/centos-bz/EZHTTP.gitcd EZHTTPchmod +x start.sh./start.sh

You can execute the git pull Synchronization Update later.
Method 2 (direct wget download ):

wget --no-check-certificate https://github.com/centos-bz/EZHTTP/archive/master.zip?time=$(date +%s) -O EZHTTP.zipunzip EZHTTP.zipcd EZHTTP-masterchmod +x start.sh./start.sh

If the download fails, replace the first line:

1. wget --no-check-certificate http://www.centos.bz/EZHTTP.zip?time=$(date +%s) -O EZHTTP.zip

1. Run./start. sh and enter 1 to enter lamp lnmp lanmp and select installation.

2. Input 2 and select lamp for installation.

3. Select the apache version. version 2.4 is recommended.

4. Enter the apache installation location and press enter to install apache on/usr/local/apache.

5. Whether to change apache compilation parameters. Generally, input n is not changed. If you are familiar with apache and have special requirements, you can enter y to modify apache compilation parameters.

6. Select mysql version. We recommend that you use mysql 5.5, mysql 5.6, or mysql 5.1 unless you have good reasons.

7. Enter the mysql installation path and press enter to install mysql on/usr/local/mysql.

8. Enter the mysql data storage location and press enter to store the data in the prompted directory. If you have other data partitions besides the root partition, we recommend that you set this directory to another Data Partition to prevent data loss when the system is damaged.

9. Set the mysql root password. If you press enter, the default password is root.

10. Whether to change mysql compilation parameters. Generally, enter n.

11. If you select the php version, we recommend 5.3 5.4. We do not recommend 5.2 unless your program can only run in version 5.2.

12. Enter the php installation path and press enter to install it in/usr/local/php.

13. Whether to change php compilation parameters. Generally, enter n

14. Install the php module. If you do not know which modules need to be installed, you can select xcache or do not select. Multiple options are separated by spaces, for example, 2 or 3.

15. install other software, and separate multiple software with spaces, for example, 2 and 3.

16. Set the installation path of the software. If phpmyadmin is used, do not set it. Just press Enter.

17. Confirm the installation. The following is a preview of all your previous settings. If no error is found, enter y to start installation. Otherwise, enter n to reset the settings.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.