在phpstudy2018中,本想部署5.6php+nginx+虚拟域名tp5.com,可是无论如何都不成功,文件程序目录在c:\www\tp5里面,在这样环境中显示500错误,最后还是没有找到问题,部署微擎和dedecms都没有任何问题.网上有很多修改配置文件的,没有一个可以成功的,我把目录指向c:\www\tp5\public,最终放弃.

只好改成apache试试看看能不能成功,没想到成功了一样是指向c:\www\tp5\public,配置文件要在vhosts.ini里面,全部配置如下

<VirtualHost _default_:80>
DocumentRoot "C:\www"
  <Directory "C:\www">
    Options +Indexes +FollowSymLinks +ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
    Require all granted
  </Directory>
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "C:\www\tp5\public"
    ServerName tp5.com
    ServerAlias 
  <Directory "C:\www\tp5\public">
      Options FollowSymLinks ExecCGI
      AllowOverride All
      Order allow,deny
      Allow from all
     Require all granted
  </Directory>
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "C:\www\hxcms"
    ServerName hxcms.com
    ServerAlias 
  <Directory "C:\www\hxcms">
      Options FollowSymLinks ExecCGI
      AllowOverride All
      Order allow,deny
      Allow from all
     Require all granted
  </Directory>
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "C:\www\dedecms"
    ServerName dedecms.com
    ServerAlias 
  <Directory "C:\www\dedecms">
      Options FollowSymLinks ExecCGI
      AllowOverride All
      Order allow,deny
      Allow from all
     Require all granted
  </Directory>
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "C:\wwwweixin"
    ServerName weixin
    ServerAlias 
  <Directory "C:\wwwweixin">
      Options FollowSymLinks ExecCGI
      AllowOverride All
      Order allow,deny
      Allow from all
     Require all granted
  </Directory>
</VirtualHost>

最后访问没有任何问题.
host文件修改如下

127.0.0.1       localhost
127.0.0.1     tp5.com
127.0.0.1       hxcms.com
127.0.0.1       dedecms.com
127.0.0.1       weixin.com

标签: none

评论已关闭