How to run php on linux

王林
Release: 2023-02-26 16:24:01
Original
7108 people have browsed it

How to run php on linux

1. Open the linux command line.

2. Find the directory of the php executable file in the Linux environment. as the picture shows. My directory is /usr/local/server/php/bin, make a note of this directory.

How to run php on linux

3. Find the directory where the php file you want to run is located, and just write some php code, /usr/local/server/apache/htdocs/test.php, Make a note of this directory and start running it officially.

4. Open the linux command line just opened in the first step, enter /usr/local/server/php/bin/php /usr/local/server/apache/htdocs/test.php (that is, enter in sequence The two directories just mentioned) Note that there are spaces between the two directories.

5. Press Enter and you can see that the php file has been executed correctly.

Recommended tutorial:PHP video tutorial

The above is the detailed content of How to run php on linux. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!