Configuration and running of PHP-mac

Source: Internet
Author: User
Configuration and running in PHP-mac are idle (can this be done ?), Recently, I am looking at the small gap between the company's code, changing my mind and learning php.

Unexpectedly, I encountered a lot of problems when configuring php. I simply pasted my configuration process.


First of all, it is clear that I use mac and php already exists in the OS.

Enter php-v on the terminal to check the php version.



My computer is php5.4.


OK, configure Apache.

Terminal input "sudo apachectl start" to start apache

Enter localhost in the browser and you will find that php can run.


OK. this is the php that comes with the system. let's write the php page by ourselves.

Open/Library/WebServer/Documents/create an index. php

Edit index. php (pay attention to permission issues. it is very easy to think about how to handle the issue)

Write only

This is to print the specific php information

OK. In fact, php cannot run this file at this time. you need to modify one configuration.

Run sudo vi/etc/apache2/httpd. conf on the terminal to open the apache configuration file.

Find "# LoadModule php5_module libexec/apache2/libphp5.so", remove the # sign, save it (enter w in the command line), and exit vi (enter q in the command line)

OK. enter sudo apachectl restart to restart apache.

Enter localhost/index. php in the browser.

This is really OK.


The above is a manual php, we generally use IDE.

Of course, PHP has many IDEs. I chose PHPStorm.

Also encountered a problem. if you use the php on your computer, it may not work.

Download phpstorm http://www.jetbrains.com/phpstorm/ first

After the installation is complete, enter the following License to crack:

User name

EMBRACE

License key

===== License begin ====

43136-12042010

20172usvson704l "dILe1PVx3y4" B3

49AU6oSDJrsjE8nMOQh "8 HTDJHIUUh

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 (php on the local machine is not needed because php-cig is missing)

Phpstorm-> preferences-> php-> the box on the right of Interpreter

Click PHPhome



OK. All configurations are complete.


Thanks.

Http://jingyan.baidu.com/article/fea4511a4e191cf7bb912511.html

Http://blog.csdn.net/jdj_1027/article/details/7732578

Http://blog.csdn.net/meegomeego/article/details/36020553

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.