ตอนที่ ๒
ติดตั้ง PHP
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
เอาหล่ะครับ ต่อไป ก็ให้ไปที่ php.net ครับ แล้วกดที่ Downloads
(On the next step we'll install PHP. Go to php.net and click downloads)
ไปที่ส่วนของ
Windows Binaries ครับ แล้วกดตรงลิงค์ Installer เลยครับ
(Download the latest Windows Installer Binary)
ลงไปตรงประเทศไทยแล้วเลือก Mirror ครับ (ผมเลือกอันที่ 2)
(Pick a mirror)
รอโหลดไฟล์ให้เสร็จ แล้วเปิดโปรแกรม จะเห็นแบบนี้ครับ
(Download it and when it finishes open it. You will see:)
** ให้เก็บตัว Installer ไว้ เพราะว่า ถ้าต้องการเพิ่ม Extension ต่างๆ สามารถใช้ตัวนี้ำได้ **
(Don't delete the installer! You should keep it so it's easier to install more extensions)
พอมาถึงตรงที่ให้เลือกที่อยู่ของไฟล์ ก็ให้สั้นๆ เหมือนกันครับ ผมเลือก
c:\php(Select the path, keep it short; I used: c:\php)
เลือก Apache 2.2 Module ครับ เพราะเราลง Apache 2.2 ไำปแล้ว
(We've installed Apache 2.2 so we select Apache 2.2 module.)
ต่อไปโปรแกรมจะให้เราเลือกที่อยู่ของไฟล์ Config ของ Apache ในที่นี้เป็น C:\apache2\conf
(Select the configuration file directory. In my case it's c:\apache2\conf)
เลือก Extension ที่ต้องการลงครับ ที่สำคัญๆ ก็มี GD, MySQL, mcrypt, cURL, OpenSSL, ฯลฯ
(Select the extensions...)
์Nextๆๆๆๆ Finish .... พอลงโปรแกรมเสร็จแล้ว Start -> Run -> services.msc แล้วไปที่ Apache2 กด Restart ครับ
(Finish the installation and when it's finished go to start menu, run, services.msc,)
(click at Apache2 and then click restart)
ไปที่ C:\apache2\htdocs แล้วสร้างไฟล์ชื่อ test.php เขียนโค้ดลงไป
(Create a test file, called test.php and put it in htdocs dir)
<?php phpinfo();
?>ลองเปิด http://localhost/test.php ถ้าใช้ได้จะเห็นแบบนี้ครับ
(Run the test program in your browser. You should see:)
ตอนต่อไปเราจะลง MySQL กันครับ
(In the next episode we'll install MySQL)