Configure xampp + thinkphp solution in mac, xamppthinkphp
I recently switched to the background for the UML course. for quick and agile development, we chose the thinkphp framework, the Chinese framework is easy to understand (this sentence is not what I said)
First, install the integration environment, that is, apache + mysql + php. A wampserver can be integrated with one click.
The problem is that my computer is a macbook, and wampserver does not have a mac version !!! I wiped it.
But, there is no path to perfection, xampp is also a one-click integration, and there is a mac version! First, download the dmg file from the xampp official website. After installation, open the app and start all services. At this time, problems may occur on mac OS 10.10, that is, mysql in Mac xampp cannot be started.
The solution is as follows:
sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start
Okay, this solves the problem. Download thinkphp3.2 from the official website, and then cd/Applications/XAMPP/xamppfiles/htdocs
To the htdocs folder, create an app folder, and decompress thinkphp to the app folder.
As shown in:
Enter http: // localhost/app in the browser
No permission found !!! As shown in:
Don't worry! This indicates that the PHP file in the folder does not have the permission. Open the command line, enter the htdocs folder in the XAMPP folder, press chmod 777 app, and then cd app, then press chmod-R 777 *
You can recursively grant permissions to all subdirectories and self-files in the app folder. In this case, you can open the browser and enter localhost: the app will see the following interface.
Some children may ask, "command line tools cannot be used to add cd files to the Applications folder. Even if you enter the application folder, hitting ls does not display files.
In this case, we can install a plug-in, Go2Shell, which can directly open the command line in the current directory. You can search for this tool by yourself ~
Now, you can officially use mac for php development!