Busy in the spare (so say? Recently, looking at small gaps in the company code, swapping brains, learning PHP.
Unexpectedly, the configuration of PHP encountered, a lot of problems, I simply paste their own configuration process it.
First of all, I'm using a Mac and I already have PHP in the OS.
Terminal input PHP-V Check the PHP version
I can see that my computer is php5.4.
OK, configure Apache below.
Terminal input "sudo apachectl start" launches Apache
Enter localhost in the browser to find that PHP is ready to run
Ok this is the system comes with PHP, below we began to write their own PHP page
Open /library (Resource library)/webserver/documents/create a new index.php
Edit index.php (Note that there are permissions issues, how to handle yourself to think of ways, very simple)
Write only <?php iphpinfo ()?>
This is the specific information to print PHP
OK, in fact, PHP can not run this file at this time, need to change a configuration
Terminal Run sudo vi/etc/apache2/httpd.conf open apache config file
Find "#LoadModule php5_module libexec/apache2/libphp5.so", remove the previous #, save (enter in command line: W) and Exit VI (input at command line: q)
OK, terminal input sudo apachectl restart reboot Apache
Re-enter localhost/index.php in the browser
This is really OK.
The above is written by hand PHP, we generally use the IDE.
Of course, PHP is a lot of IDE, I chose the Phpstorm
Also encounter a problem if you use your own computer with PHP may not run out
Download Phpstorm http://www.jetbrains.com/phpstorm/ First
After the installation is complete, enter the following license to hack:
User Name
Embrace
License Key
===== LICENSE BEGIN =====
43136-12042010
00002usvson704l "Dile1pvx3y4" B3
49AU6OSDJRSJE8NMOQH "8HTDJHIUUh
gd1bebyc5u "6oxdbvsalb4eb10pw8"
===== LICENSE END =====
OK open new Project new PHP
Open Terminal input
Curl-s http://php-osx.liip.ch/install.sh | Bash-s 5.5
Install php5.5 (without native PHP because of lack of php-cig)
Phpstorm->preferences->php->interpreter Right Square
Phphome after the opening.
Ok this is all configured to complete
Thanks a bit.
Http://jingyan.baidu.com/article/fea4511a4e191cf7bb912511.html
http://blog.csdn.net/jdj_1027/article/details/7732578
http://blog.csdn.net/meegomeego/article/details/36020553
Configuration and operation under the Php-mac