Home >Backend Development >PHP Tutorial >homebrew安装apache顺序?

homebrew安装apache顺序?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-06 20:12:571088browse

如题,
我要用homebrew安装apache php
当我用homebrew安装apache时
如果安装apache时前面已经安装过php,则无论如何配置,访问任何一个php文件全部返回源代码。
如果我先安装apache后安装php,配置
LoadModule php5_module /usr/local/Cellar/php53/5.3.29/libexec/apache2/libphp5.so

<code>AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

<ifmodule mod_dir.c>
    DirectoryIndex index.html index.php
</ifmodule></code>


就可以愉快的让php运行。
这是咋回事??
PS:成功运行后phpinfo显示Server API Apache 2.0 Handler
不知道跟这个有没有关系??
感觉好神奇~

回复内容:

如题,
我要用homebrew安装apache php
当我用homebrew安装apache时
如果安装apache时前面已经安装过php,则无论如何配置,访问任何一个php文件全部返回源代码。
如果我先安装apache后安装php,配置
LoadModule php5_module /usr/local/Cellar/php53/5.3.29/libexec/apache2/libphp5.so

<code>AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

<ifmodule mod_dir.c>
    DirectoryIndex index.html index.php
</ifmodule></code>


就可以愉快的让php运行。
这是咋回事??
PS:成功运行后phpinfo显示Server API Apache 2.0 Handler
不知道跟这个有没有关系??
感觉好神奇~

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn