Quản trị net diễn đàn chia sẻ thông tin các thủ thuật mạng, internet bảo mật thông tin dành cho giới IT VIệt hy vọng là nơi bổ ích cho cộng đồng

Quản trị net diễn đàn chia sẻ thông tin các thủ thuật mạng, internet bảo mật thông tin dành cho giới IT VIệt hy vọng là nơi bổ ích cho cộng đồng (http://quantrinet.com/forum/index.php)
-   Quản trị Server web IIS, FTP Server (http://quantrinet.com/forum/forumdisplay.php?f=87)
-   -   Install PHP - MySQL with IIS (http://quantrinet.com/forum/showthread.php?t=4565)

hoctinhoc 17-01-2010 04:29 PM

Install PHP - MySQL with IIS
 
Install PHP - MySQL with IIS
Bài trước, LDP đã post LAB trỏ domain về PC cá nhân. Hôm nay LDP sẽ tiếp tục post LAB setup PHP - MYSQL với IIS.

Yêu cầu:
- Windows Server 2003 với IIS 6
- PHP v4.4.6 <-- download
- MySQL v4.1.22 <-- download

Thực hiện :

1. Install IIS
- Vào Control Panel > Add Remove Program > Add Remove Windows Components.
- Chọn Application Server > Internet Information Service > World Wide Web Service > World Wide Web Service
- Kiểm tra quá trình install có thành công bằng cách mở IE, gõ http://localhost

Các bạn có thể thực hiện các bước như hình bên dưới

http://nhatnghe.com/forum/undefined/.../wol_error.gifClick this bar to view the full image.http://www.nhatnghe.com/forum/_lab/iis-php-mysql/b1.jpg

2. Install PHP
- Download source PHP > Giải nén vào ổ C:\PHP
- Click phải My Computer > Property > chọn Tab Advance > chọn Environment Variables > Chọn Path > Edit > Thêm C:\PHP vào. Restart Windows.
Lưu ý : với mỗi path phải cách nhau bằng dấu ;

http://nhatnghe.com/forum/undefined/.../wol_error.gifClick this bar to view the full image.http://www.nhatnghe.com/forum/_lab/iis-php-mysql/b2.jpg

- Copy file C:\PHP\sapi\php4isapi.dll vào C:\PHP
- Rename file php.ini-dist thành php.ini
- Vào Start > Run > gõ php.ini. Nếu báo lỗi nghĩa là bước Variables Path chưa thành công, cần kiểm tra lại. Edit vài thông số trong php.ini như sau :

Tìm :
PHP Code:
extension_dir =

Thay bằng :
PHP Code:
extension_dir = "C:\PHP\Extensions"

Save file php.ini lại.

3. Configure IIS để có thể sử dụng PHP
- Vào Administrative Tool > mở Internet Information Services (IIS) Manager
- Thực hiện các bước như hình bên dưới :

http://nhatnghe.com/forum/undefined/.../wol_error.gifClick this bar to view the full image.http://www.nhatnghe.com/forum/_lab/iis-php-mysql/b3.jpg

- Cũng ở Internet Information Services (IIS) Manager > Chọn Web Service Extension > làm theo hình bên dưới :

http://nhatnghe.com/forum/undefined/.../wol_error.gifClick this bar to view the full image.http://www.nhatnghe.com/forum/_lab/iis-php-mysql/b4.jpg

- Kiểm tra lại extension PHP ISAPI đã được allow ? Sau đó restart IIS.

http://nhatnghe.com/forum/undefined/.../wol_error.gifClick this bar to view the full image.http://www.nhatnghe.com/forum/_lab/iis-php-mysql/b5.jpg

http://nhatnghe.com/forum/undefined/.../wol_error.gifClick this bar to view the full image.http://www.nhatnghe.com/forum/_lab/iis-php-mysql/b6.jpg

- Kiểm tra PHP đã hoạt động bằng cách tạo một file với nội dung như sau :
PHP Code:
<?php
phpinfo
();
?>

save lại với tên phpinfo.php và đặt vào folder C:\Inetpub\wwwroot\

- Mở IE, gõ http://localhost/phpinfo.php. Nếu IE hiển thị nội dung như hình bên dưới là bạn đã thành công.

http://nhatnghe.com/forum/undefined/.../wol_error.gifClick this bar to view the full image.http://www.nhatnghe.com/forum/_lab/iis-php-mysql/b7.jpg

- Nếu IE báo lỗi "The page cannot be found", chúng ta cần kiểm tra lại permission của file php4isapi.dll. Mở C:\PHP, chọn file php4isapi.dll > chọn Property. Kiểm tra các user cần thiết như NETWORK SERVICE, ISUR_computername, đã có quyền read ? Nếu không có, các bạn sẽ phải add vào. Xem hình bên dưới :
http://nhatnghe.com/forum/undefined/.../wol_error.gifClick this bar to view the full image.http://www.nhatnghe.com/forum/_lab/iis-php-mysql/b8.jpg
- Sau khi add permission, các bạn thử lại sẽ thành công. Nếu vẫn còn báo lỗi khác, các bạn có thể post lỗi lên đây, mọi người sẽ giúp các bạn.

4. Install MySQL
Setup MySQL rất đơn giản, các bạn chỉ cần làm theo hình là được.

http://nhatnghe.com/forum/undefined/.../wol_error.gifClick this bar to view the full image.http://www.nhatnghe.com/forum/_lab/i...ctures-011.jpg

http://nhatnghe.com/forum/undefined/.../wol_error.gifClick this bar to view the full image.http://www.nhatnghe.com/forum/_lab/i...ctures-012.jpg

http://nhatnghe.com/forum/undefined/.../wol_error.gifClick this bar to view the full image.http://www.nhatnghe.com/forum/_lab/i...ctures-013.jpg

http://nhatnghe.com/forum/undefined/.../wol_error.gifClick this bar to view the full image.http://www.nhatnghe.com/forum/_lab/i...ctures-014.jpg

http://nhatnghe.com/forum/undefined/.../wol_error.gifClick this bar to view the full image.http://www.nhatnghe.com/forum/_lab/i...ctures-015.jpg

http://nhatnghe.com/forum/undefined/.../wol_error.gifClick this bar to view the full image.http://www.nhatnghe.com/forum/_lab/i...ctures-016.jpg

http://nhatnghe.com/forum/undefined/.../wol_error.gifClick this bar to view the full image.http://www.nhatnghe.com/forum/_lab/i...ctures-017.jpg

http://nhatnghe.com/forum/undefined/.../wol_error.gifClick this bar to view the full image.http://www.nhatnghe.com/forum/_lab/i...ctures-018.jpg

http://nhatnghe.com/forum/undefined/.../wol_error.gifClick this bar to view the full image.http://www.nhatnghe.com/forum/_lab/i...ctures-019.jpg

http://nhatnghe.com/forum/undefined/.../wol_error.gifClick this bar to view the full image.http://www.nhatnghe.com/forum/_lab/i...ctures-020.jpg

http://nhatnghe.com/forum/undefined/.../wol_error.gifClick this bar to view the full image.http://www.nhatnghe.com/forum/_lab/i...ctures-021.jpg

http://nhatnghe.com/forum/undefined/.../wol_error.gifClick this bar to view the full image.http://www.nhatnghe.com/forum/_lab/i...ctures-022.jpg

http://nhatnghe.com/forum/undefined/.../wol_error.gifClick this bar to view the full image.http://www.nhatnghe.com/forum/_lab/i...ctures-023.jpg

http://nhatnghe.com/forum/undefined/.../wol_error.gifClick this bar to view the full image.http://www.nhatnghe.com/forum/_lab/i...ctures-024.jpg

http://nhatnghe.com/forum/undefined/.../wol_error.gifClick this bar to view the full image.http://www.nhatnghe.com/forum/_lab/i...ctures-025.jpg

http://nhatnghe.com/forum/undefined/.../wol_error.gifClick this bar to view the full image.http://www.nhatnghe.com/forum/_lab/i...ctures-026.jpg

http://nhatnghe.com/forum/undefined/.../wol_error.gifClick this bar to view the full image.http://www.nhatnghe.com/forum/_lab/i...ctures-027.jpg

http://nhatnghe.com/forum/undefined/.../wol_error.gifClick this bar to view the full image.http://www.nhatnghe.com/forum/_lab/i...ctures-028.jpg


5. Kiểm tra
- Có rất nhiều cách để kiểm tra PHP và MySQL đã hoạt động tốt. Cách đơn giản nhất vẫn là check phpinfo. Nếu bạn có được kết quả như hình bên dưới nghĩa là bạn đã thành công http://nhatnghe.com/forum/images/smilies/biggg/cool.gif

http://nhatnghe.com/forum/undefined/.../wol_error.gifClick this bar to view the full image.http://www.nhatnghe.com/forum/_lab/i...ctures-029.jpg

Lê Duy Phương

:battay:


Bây giờ là 04:39 PM. Giờ GMT +7

Diễn đàn tin học QuantriNet
quantrinet.com | quantrimang.co.cc
Founded by Trương Văn Phương | Developed by QuantriNet's members.
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.