Configuration and operation under the Php-mac

Source: Internet
Author: User
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

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

  • 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.