How do I add a PHP directory to the Windows path?

Source: Internet
Author: User

  • Under Windows NT,2000,XP and 2003:

    • Go to Control Panel and open the System icon (start, Settings, Control Panel, System, Windows xp/2003 In: Start, Control Panel, System)

    • Select Advanced tab

    • Click the Environment Variables button

    • In the System variables column

    • Found path (may need to scroll down to find)

    • Mouse Double-click Path this item

    • Add your PHP directory at the end, including the previous ";" (For example: ; C:\php )

    • Click OK and restart your computer

    Need to edit the Autoexec.bat file in Windows 98/me:

    • Open Notepad (start and run, then enter Notepad and click OK)

    • Open C:\autoexec.bat file

    • Find this line: path=c:\windows; C:\WINDOWS\COMMAND; And at last add ; C:\php

    • Save the file and restart the computer

    Note :     &NBS P     Remember to restart after the above modifications to ensure that the change to path takes effect.        

    The PHP manual used to advocate copying files to the Windows system directory because of the directory (C:\WINDOWS,C:\WINNT, And so on) are in the system path by default. But copying files to the Windows system directory is a long-overdue approach and can cause problems.

    • How do I make the php.ini file available to PHP under Windows?

    • There are several ways. If you are using Apache, read the specific installation instructions (Apache 1, Apache 2), otherwise you must set the PHPRC environment variable:

      In Windows NT,2000,XP and 2003 kinds:

      • Go to the Control Panel and open the System icon (starting with settings, Control Panel, System, Windows xp/2003: Start, Control Panel, System)

      • Select the Advanced tab

      • Click on the "Environment variables" button

      • In the System Variables column

      • Click the "New" button and enter "PHPRC" in "Variable name" and enter the directory where the php.ini file is located in the variable value (for example: C:\php)

      • Click "OK" and restart your computer

      In Windows 98/me, you need to edit the Autoexec.bat file:

      • Open Notepad (start and run, then enter Notepad and click OK)

      • Open C:\autoexec.bat File

      • Add a line at the end of the file: set phprc=c:\php(replace C:\php with your php.ini actual directory). Note the path cannot contain spaces. For example, to install PHP into the C:\Program files\php, you need to enter the c:\progra~1\php replacement

      • Save the file and restart your computer


How do I add a PHP directory to the Windows path?

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.