希望有人觉得它有用...
cakephp_3_xx
xampp v 3.2.1
第 1 部分(使用包含 cakePHP 的服务器测试 cakePHP 是否正常工作)
按照 cakePHP 导师创建数据库
在 bake.bat -- 添加 php 路径:
J:\xampp\php\php "%lib%cake.php" %*
DOS提示符:
J:\xampp\htdocs\cakephp-3-1-6>.\bin\cake bake all users
J:\xampp\htdocs\cakephp-3-1-6>.\bin\cake bake all bookmarks
J:\xampp\htdocs\cakephp-3-1-6>.\bin\cake bake all tags
cmd> cd J:\xampp\htdocs\cakephp-3-1-6
J:\xampp\htdocs\cakephp-3-1-6>set PATH=%PATH%;J:\xampp\php\;
J:\xampp\htdocs\cakephp-3-1-6>bin\cake server
看看它http://localhost:8765/
第 2 部分(例如,如果我们有 8787 端口可供虚拟主机使用)
重复(对于 J:\xampp\apps\bookmarker)
在 bake.bat -- 添加 php 路径:
J:\xampp\php\php "%lib%cake.php" %*
DOS提示符:
J:\xampp\apps\bookmarker>.\bin\cake bake all users
J:\xampp\apps\bookmarker>.\bin\cake bake all bookmarks
J:\xampp\apps\bookmarker>.\bin\cake bake all tags
J:\xampp\htdocs\applications.html (create your own application section...:
<!-- START cakephp-3-0-0 bookmarker -->
<div align="center" class="module_table">
)
...
<div align="right" class="module_access"><a target="_blank" name="bookmarker" href="http://localhost:8787/bookmarks">Access</a></div>
...
1) 主 httpd.conf。
Listen 8787
<VirtualHost *:8787>
DocumentRoot "J:\xampp\apps\bookmarker"
# ServerName www.example.com
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory "J:\xampp\apps\bookmarker" >
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order Allow,Deny
Allow from all
</Directory>
# Other directives here
</VirtualHost>
不要包含 apache 的应用程序特定配置:
# Include "J:/xampp/apps/bookmarker/conf/httpd-prefix.conf"
2)关键:css工作:在webroot/.htaccess
#<IfModule mod_rewrite.c>
# RewriteEngine On
# ## RewriteBase J:\xampp\apps\bookmarker\src\
# RewriteCond %{REQUEST_FILENAME} !-f
# RewriteRule ^ index.php [L]
#</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>
其余的由 cakePHP bake 安装,可以通过 xampp 应用程序界面或直接尝试:
http://localhost:8787/bookmarks