Why can't I run my Php script in a browser and run it in php?

Source: Internet
Author: User
Please come in. Why can I execute my Php script in the browser? why can I execute it in the browser, when I run the php command, an error is reported, indicating that the driver cannot be found? My script uses pdo to connect to sqlserver, but my pdo is installed and enable. it is no problem to execute it in the browser. The result is php xxxx. if php commands are used to batch process this php script, an error is reported, but the driver cannot be found?


Reply to discussion (solution)

Php running in web mode and command line mode uses different php. ini

If you have a single PHP file and an error is reported, the syntax is incorrect.
If other PHP files are introduced, the path is incorrect.

Php running in web mode and command line mode uses different php. ini

Thanks for your guidance, The-c parameter is used to solve the problem.

If you have a single PHP file and an error is reported, the syntax is incorrect.
If other PHP files are introduced, the path is incorrect.

This is indeed the question on the first floor.

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.