> 백엔드 개발 > PHP 튜토리얼 > Installing LightTPD and PHP on Windows

Installing LightTPD and PHP on Windows

WBOY
풀어 주다: 2016-06-23 14:33:15
원래의
1087명이 탐색했습니다.

转自:http://www.winstonyw.com/2008/05/28/installing-lighttpd-and-php-on-windows/

This blog is in need of a makeover, and so I am trying to keep the procrastination habit at bay, practice some GTD and get started on creating a new template for it. First of all, I need a local development environment for PHP on Windows, since I am a Windows user. Previously, I would have installed IIS on Windows and used it as the server for PHP, but it’s always a chore trying to find my Windows CD.

Fortunately, I learnt about LightTPD recently in my work at Wego and how I can use it to replace IIS as the server for PHP. It’s easy installation and setup within minutes. Great! Let’s get started!

1. Download and Install PHP

Download PHP from PHP website. I chose the zip package and simply unzipped it into my directory of choice: Almighty C drive! So now, it’s residing at “C:"php”.

2. Download and Install LightTPD

Download a Win32 version of LightTPD from the WLMP Project; I chose the Setup Wizard (.exe) version.

Double-click on the downloaded executable to start the short installation process, during which you would specify the destination of the install. I installed mine at “C:"Program Files"LightTPD”.

3. Start and Test LightTPD

To start LightTPD, go to the LightTPD directory (i.e. “C:"Program Files"LightTPD”), find the file “TestMode.bat” and double-click on it. A console window would open and indicate that the server has been started.

To test that LightTPD is working at this moment, point your browser to http://localhost. You should see a “LightTPD Test Page”.

That was easy right? Now we just need to edit some configurations to make PHP work with LightTPD.

4. Editing LightTPD Configurations

Edit the file lighttpd-inc.conf (i.e. “C:"Program Files"LightTPD"conf"lighttpd-inc.conf”) with the following:

Remove the comment tag for “mod-cgi” (Line 20) Add this line (assuming that PHP was installed on C drive): cgi.assign = ( “.php” => “C:/php/php-cgi.exe” ) 5. Editing PHP Configurations

In your PHP directory, rename the file php.ini-recommended to php.ini and edit php.ini with the following:

short_open_tag = On display_errors = On doc_root = “C:"Progra~1"LightTPD"htdocs” 6. Test PHP with LightTPD

To test that LightTPD now works with PHP, create a file with the following contents:

View Plain Copy to Clipboard Print ?

 

Place the file in your htdocs directory (i.e. “C:"Program Files"LightTPD"htdocs”), open up your browser and browse to the page. Walaa! You should be able to see the standard phpinfo() messages.

There you have it! A development environment for PHP on Windows in 6 simple steps. Now, to get started on the new template..

원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿