How to execute PHP scripts in linux

Source: Internet
Author: User

In Linux, how does one directly execute the php script? Below are some php Command Line parameters.

Usage

Php [-q] [-h] [-s] [-v] [-I] [-f] | {[args...]}

-Q quiet mode, no HTTP header output

-S converts php program files to HTML in color format (for example, the reserved words are green, the functions and variables are blue, the comments are yellow, and the strings are red .)

-F read and interpret the specified file

-C reads the php. ini file in

-A Interactive Operation

-D foo [= bar] defines the input item foo in ini as bar.

-E outputs additional information for debugging and Performance Analysis

-Z: Call Zend extension file

-I php-related information

-H help

Example:

/Usr/local/bin/php/home/script/www.phpernote.com. php

// Directly execute the/home/script/www.phpernote.com. php file

Nohup/usr/local/bin/php/home/script/www.phpernote.com. php>/home/script/result. log

// Run the/home/script/www.phpernote.com. php file without hanging up (in the background) and redirect the output to the/home/script/result. log file.

*/1 ***** root-q/usr/local/bin/php/home/script/www.phpernote.com. php

// Execute the script/home/script/www.phpernote.com. php once every minute.

Note:

(1) If you do not know the directory of the php Execution program, you can directly enter the command where is php to obtain the php.exe directory.

(2) Before executing a command, you need to convert the executed file into an executable script file. Example: chmod + x www.phpernote.com. php

Articles you may be interested in
  • How many lines of files can be viewed in linux?
  • How to Use xampp to build a php VM
  • How to open the PHP file and execute the PHP File
  • How to know that the SQL statements executed in the database are slow
  • Solve the js and css cache problems on linux servers
  • How to run php files in the command line in windows
  • Jquery waits for the ajax execution to complete and then continues to execute the following code.
  • Jquery achieves the effect of table row-changing

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.