Apache-How to Use php commands globally

Source: Internet
Author: User
I am Windows 7 and use the php environment (installation path f: xampp) built with xampp to directly use the php Command globally: php.exe under xamppphp is lost to windowssystem32, but the php Command still cannot be used in the console. It must be cd to f: xamppphp. I am win7, And the php environment built with xampp (installation path f:/xampp)
To facilitate the use of php commands globally
I dropped php.exe under f:/xampp/PHP to windows/system32.
However, you still cannot use the php Command on the console. The command must be cd to f:/xampp/php.

Reply content:

I am Windows 7. I used xampp to build the php environment (installation path f:/xampp)
To facilitate the use of php commands globally
I dropped php.exe under f:/xampp/PHP to windows/system32.
However, you still cannot use the php Command on the console. The command must be cd to f:/xampp/php.

Add the PHP file PATH to the environment variable PATH.

Setx PATH "% PATH %; Your PHP folder PATH"

After the addition, when CLI and CGI run PHPPhp. iniIf it is not the same file, run the following command:

Php-I | findstr php. ini

CheckPhp. iniFile Location.

This is not directly related to the directory where php is installed. You can add the php installation path to the environment variable to access it globally on the computer.

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.