TODO:macOS上ThinkPHP5和Semantic-UI集成php
1. 全局安装 (on OSX via homebrew)Composer 是 homebrew-php 项目的一部分css
2. 把Xcode升级到8.1后继续安装Composergit
3. 使用composer建立TP5项目MWL-Dispatchgithub
composer create-project topthink/think MWL-Dispatchapache
4. 配置apache,设置Virtual hosts,api
在httpd.conf中找到“#Include /private/etc/apache2/extra/httpd-vhosts.conf”,去掉前面的“#”,并保存。app
找到composer
<Directory />ide
AllowOverride none字体
Require all denied
</Directory>
改为
<Directory />
AllowOverride none
Require all granted
</Directory>
5. 对项目runtime文件夹设置写对权限
sudo chmod -R a+w ./runtime/
6. 在httpd-vhost.conf添加配置
<VirtualHost *:80>
DocumentRoot “/Users/wuyong/data/ludong/xcx/php/MWL-Dispatch/public”
ServerName mwl-dispatch.com
ErrorLog “/private/var/log/apache2/mwl-dispatch-error_log”
CustomLog “/private/var/log/apache2/mwl-dispatch-access_log” common
</VirtualHost>
7. 自动建立模块,把根目录的build.php拷贝到application下,而后在项目目录下运行php think build –module test,必定要在根目录下执行这个目录,否则会出现“Could not open input file: think”
8. 从GitHub下载Semantic-UI,把相应的css,js拷贝到public文件夹下,同时把googleapi的字体下载到本地,这样能够减小网站打开的加载速度,不少人决定Semantic慢也许就是由于要加载google字体致使的,也有建议把fonts.googleapis.com改为fonts.useso.com,我的感受仍是慢,仍是没有本地的加载快。
本例的源码分享在GitHub(https://github.com/SomeTODO/MWL-Dispatch)上,会不断完善而且使用起来。
wxgzh:ludong86