[opensuse] Apache2 and PHP5 on 11.1
Well My apache2 server will not display php web pages. If I try to load a page in my browser I get a message saying that (e.g.) index.php is a pdf file and asks what app would I like to open it with. I have apache2, php5 and mod_php5 installed but apache will not load a php5 page. /etc/sysconfig/apache2 has php5 set in APACHE_MODULES. mod_php5 is listed in /etc/apache2/sysconfig.d/loadmodule.conf. The file conf.d/php5.conf. I had this working on 9.3 and 10.3 ut can't get it working on 1.1. What am I missing? Thanks! Bob -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Thu, Jan 29, 2009 at 4:37 PM, Robert Paulsen <robert@paulsenonline.net> wrote:
Well My apache2 server will not display php web pages. If I try to load a page in my browser I get a message saying that (e.g.) index.php is a pdf file and asks what app would I like to open it with.
I have apache2, php5 and mod_php5 installed but apache will not load a php5 page.
/etc/sysconfig/apache2 has php5 set in APACHE_MODULES. mod_php5 is listed in /etc/apache2/sysconfig.d/loadmodule.conf. The file conf.d/php5.conf.
I had this working on 9.3 and 10.3 ut can't get it working on 1.1. What am I missing?
Do you have this? AddHandler application/x-httpd-php .php4 AddHandler application/x-httpd-php .php5 AddHandler application/x-httpd-php .php AddHandler application/x-httpd-php-source .php4s AddHandler application/x-httpd-php-source .php5s AddHandler application/x-httpd-php-source .phps DirectoryIndex index.php4 DirectoryIndex index.php5 DirectoryIndex index.php -- Kind Regards -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Thursday 29 January 2009 1:11 pm, Gabriel wrote:
Do you have this?
AddHandler application/x-httpd-php .php4 AddHandler application/x-httpd-php .php5 AddHandler application/x-httpd-php .php AddHandler application/x-httpd-php-source .php4s AddHandler application/x-httpd-php-source .php5s AddHandler application/x-httpd-php-source .phps DirectoryIndex index.php4 DirectoryIndex index.php5 DirectoryIndex index.php
yes. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
If you php file does not have the <?php stanza at the beginning make sure your php.ini's short_open_tag setting is 'On' On Fri, Jan 30, 2009 at 3:15 AM, Robert Paulsen <robert@paulsenonline.net> wrote:
On Thursday 29 January 2009 1:11 pm, Gabriel wrote:
Do you have this?
AddHandler application/x-httpd-php .php4 AddHandler application/x-httpd-php .php5 AddHandler application/x-httpd-php .php AddHandler application/x-httpd-php-source .php4s AddHandler application/x-httpd-php-source .php5s AddHandler application/x-httpd-php-source .phps DirectoryIndex index.php4 DirectoryIndex index.php5 DirectoryIndex index.php
yes.
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Robert Paulsen escribió:
Well My apache2 server will not display php web pages.
show us you apache error_log. -- "We have art in order not to die of the truth" - Friedrich Nietzsche Cristian Rodríguez R. Software Developer Platform/OpenSUSE - Core Services SUSE LINUX Products GmbH Research & Development http://www.opensuse.org/
Robert Paulsen wrote:
Well My apache2 server will not display php web pages. If I try to load a page in my browser I get a message saying that (e.g.) index.php is a pdf file and asks what app would I like to open it with.
I have apache2, php5 and mod_php5 installed but apache will not load a php5 page.
/etc/sysconfig/apache2 has php5 set in APACHE_MODULES. mod_php5 is listed in /etc/apache2/sysconfig.d/loadmodule.conf. The file conf.d/php5.conf.
I had this working on 9.3 and 10.3 ut can't get it working on 1.1. What am I missing?
Thanks! Bob
Bob, I had the same problem with 10.3, I think. It turned out to be a really simple problem, but dammit, I can't remember exactly what the fix was. Every time I would try and open a php page, IIRC, I would just get the text or an error. There were a couple of things I had to do to migrate a server from pre-10.3 to 10.3 or later. One thing that you will have to do is to use the *full* php tags in your code like <?php to open and ?> to close. PHP itself changed to prevent the short open <? and as Low already mentioned, you can try setting the short open setting on. (I didn't, I just recoded and made everything comply with the new standard. Another *big* change if your coming from something pre-10.3 to 11.1, is the way php includes are handled. The rule now is that all includes must be in the same directory or below the calling page *or* must reside in a path defined in httpd *and* must have the full path supplied. Further, the include statement need to be of the form: <?php include '/srv/www/other-dir/page-to-include.php'; ?> The changes are for security purposes and are actually a good thing -- depending on how much code you have to change. If it isn't the php tags or the includes, I'll try digging further to recall what changed. -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (5)
-
Cristian Rodríguez
-
David C. Rankin
-
Gabriel
-
Low Kian Seong
-
Robert Paulsen