Precautions for executing PHP scripts using the PHP Command Line

Source: Internet
Author: User
If you use the wamp integrated installation environment, Your php configuration is in D: wampbinapacheApache2.2.17bin. You need to copy and overwrite php under D: wampbinphpphp5.3.3. ini. Otherwise, an error will be reported when you call the extension function, for example, Fatalerror: Calltoundefinedfunction.

If you use the wamp integrated installation environment, Your php configuration is in D: \ wamp \ bin \ apache \ Apache2.2.17 \ bin. You must copy and overwrite D: php under \ wamp \ bin \ php \ php5.3.3. ini. Otherwise, an error will be reported when you Call the extended function, for example, Fatal error: Call to undefined function.

If you use the wamp integrated installation environment, Your php configuration is in D: \ wamp \ bin \ apache \ Apache2.2.17 \ bin

You need to copy and overwrite php under D: \ wamp \ bin \ php \ php5.3.3. ini. Otherwise, an error such as Fatal error: Call to undefined function will be reported when you Call the extended function.

If you are too lazy to write such a long string of php paths, you can add D: \ wamp \ bin \ php \ php5.3.3 to the environment variable path.

In addition, we have questions about parameter passing. For example, I want to execute test. php? A = 123

In the command line, we can write php test. php 123

Use $ argv [1] In test. php to receive 123.

Attach a bat executable file for reference

@ Echo offphp D: \ wamp \ www \ taobao \ items. php 158345687php D: \ wamp \ www \ taobao \ refunds_up.php 158345687php D: \ wamp \ www \ taobao \ trade. php 158345687echo. & echo press any key to close the BAT window... & pauseexit

Original article address: Considerations for using the PHP Command Line to execute the PHP script. Thank you for sharing it with the original author.

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.