Maison >développement back-end >tutoriel php >apache配置 - apache2配置二级域名解析时无法解析php?

apache配置 - apache2配置二级域名解析时无法解析php?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBoriginal
2016-07-06 13:52:331190parcourir

已经在服务商那边搞好了二级域名的指向。
httpd.conf:

<code><virtualhost>
        DocumentRoot /var/www/www/
    ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:10000/var/www/www/$1
    DirectoryIndex index.html index.php
</virtualhost>


<virtualhost>
  DocumentRoot /var/www/www/a
  ServerName a.abc.com
  DirectoryIndex  index.php
</virtualhost>

</code>

现在我可以通过a.abc.com访问到abc.com/a,但是里面的php脚本无法运行,这是为什么呢?

回复内容:

已经在服务商那边搞好了二级域名的指向。
httpd.conf:

<code><virtualhost>
        DocumentRoot /var/www/www/
    ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:10000/var/www/www/$1
    DirectoryIndex index.html index.php
</virtualhost>


<virtualhost>
  DocumentRoot /var/www/www/a
  ServerName a.abc.com
  DirectoryIndex  index.php
</virtualhost>

</code>

现在我可以通过a.abc.com访问到abc.com/a,但是里面的php脚本无法运行,这是为什么呢?

这多明显,你没有设置php转发代理。。。

<code class="apache">ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:10000/var/www/www/a/$1</code>
Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn