I am running SUSE from an Amazon image which came pre loaded with apache2 and PHP. I have got my website up and running with a test index.html file, which works. When I do a index.php test my browser tries to download the file. Now I think this is because PHP / Apache2 is not configured correctly.
我正在从预装了apache2和PHP的Amazon映像运行SUSE。我已经启动了我的网站并运行了一个测试index.html文件,该文件有效。当我做index.php测试时,我的浏览器会尝试下载该文件。现在我认为这是因为没有正确配置PHP / Apache2。
The bit I think I need in httpd.conf is
我觉得我在httpd.conf中需要的那个是
LoadModule php5_module modules/libphp5.so
I have added this block already
我已经添加了这个块
<Files *.php>
SetOutputFilter PHP
SetInputFilter PHP
LimitRequestBody 9524288
</Files>
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
I have installed apache2-mod_php5 via zypper with the expectation that would add libphp5.so somewhere - however I can't find it. I have seen people mentioning it is built somehow in the installation of php / apache. I updated Apache2 and PHP via zypper and nada.
我已经通过zypper安装了apache2-mod_php5,期望在某处添加libphp5.so - 但是我找不到它。我看到人们提到它是在安装php / apache时以某种方式构建的。我通过zypper和nada更新了Apache2和PHP。
how do I get the file?
我怎么得到这个文件?
1 个解决方案
#1
1
The module is called mod_php5.so and lives under
该模块名为mod_php5.so,位于
/usr/lib64/apache2/mod_php5.so
It's living there along with a lot of other mods, but the php5 module is not included anywhere!
它与许多其他mod一起生活在那里,但php5模块不包含在任何地方!
So the line to add to the config (/etc/apache2/sysconfig.d/loadmodule.conf) is LoadModule php5_module /usr/lib64/apache2/mod_php5.so
所以添加到配置的行(/etc/apache2/sysconfig.d/loadmodule.conf)是LoadModule php5_module /usr/lib64/apache2/mod_php5.so
I also used the command a2enmod php to enable the mod
我还使用命令a2enmod php来启用mod
Also don't forget to restart Apache2 and clear your browser cache. httpd2 -k -restart
另外,不要忘记重启Apache2并清除浏览器缓存。 httpd2 -k -restart
#1
1
The module is called mod_php5.so and lives under
该模块名为mod_php5.so,位于
/usr/lib64/apache2/mod_php5.so
It's living there along with a lot of other mods, but the php5 module is not included anywhere!
它与许多其他mod一起生活在那里,但php5模块不包含在任何地方!
So the line to add to the config (/etc/apache2/sysconfig.d/loadmodule.conf) is LoadModule php5_module /usr/lib64/apache2/mod_php5.so
所以添加到配置的行(/etc/apache2/sysconfig.d/loadmodule.conf)是LoadModule php5_module /usr/lib64/apache2/mod_php5.so
I also used the command a2enmod php to enable the mod
我还使用命令a2enmod php来启用mod
Also don't forget to restart Apache2 and clear your browser cache. httpd2 -k -restart
另外,不要忘记重启Apache2并清除浏览器缓存。 httpd2 -k -restart