Home >Backend Development >PHP7 >How to start php7.0 after it is installed

How to start php7.0 after it is installed

PHPz
PHPzOriginal
2023-04-12 13:53:53944browse

PHP is a popular server-side scripting language. Its latest version is PHP7.0, which has relatively high performance and fast execution speed. If you want to install PHP7.0 on your server, then this article will introduce you to the installation and startup method of PHP7.0.

  1. Install PHP7.0

First, you need to install PHP7.0 on your server. You can download the latest version of PHP7.0 by visiting the official website http://php.net/downloads.php. Then follow the steps below to install:

1.1 Download PHP7.0

You can choose to download one of the following two files:

PHP7.0 zip file: This is A zip file containing all PHP files. You need to unzip it to the root directory of your server.

PHP7.0 executable file: This is an executable file that contains all PHP files. You just need to run it to install PHP7.0 on your server.

1.2 Configuring PHP7.0

After installing PHP7.0, you need to configure your server to be able to execute PHP code on the server. You can do this by modifying the php.ini file.

The php.ini file is usually located in the following directory:

Unix/Linux:/usr/local/lib/php.ini

Windows: C:\Windows\php .ini

You only need to make the following configuration in the php.ini file to complete the configuration of PHP7.0:

extension=php_mysql.dll

extension=php_mysqli. dll

extension=php_gd2.dll

extension=php_openssl.dll

Finally, you need to add your PHP7.0 installation directory to your system path.

  1. Start PHP7.0

When you complete the above steps, your PHP7.0 is ready. You can start PHP7.0 with the following command:

php -S localhost:8000

This command will start a PHP server on the local host and listen to port 8000 on the local host.

If you have installed PHP7.0 but your server has not been started, you can start PHP7.0 with the following command:

sudo service php7.0-fpm start

This command will start the FastCGI process manager of PHP7.0.

Summary

Installing PHP7.0 is really simple, just follow the above steps. Once completed, you can easily execute PHP7.0 code on your server!

The above is the detailed content of How to start php7.0 after it is installed. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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