Jump to content

PHP Includes for .TPL Suddenly Throwing 500 Error


Recommended Posts

My site has been working fine for years but, all of a sudden, is throwing server errors on the pages that call for PHP includes. My provider isn't saying whether there's been an update but the fact that the site has always worked fine and now isn't, well...

 

So, here's some sample code from a .html page that calls for the TPL file:

 

<?php include('/home/MyPath/public_html/MySite.com/tpl/footer.tpl'); ?>

 

A long time ago, I was told to put this in my htaccess file:

 

AddType application/x-httpd-php5 .html

AddHandler application/x-httpd-php5 .html

 

If I delete both of these lines from the htaccess file, the site will load without the internal server error but my includes don't work at all. There's just an empty space where the content from the tpl file is supposed to be. I know they installed php 5.4 but my site was automatically put on 5.2 as a default.

 

I submitted a ticket with my provider and this was the response.

This is the error message as it is being recorded from the server itself when the domain returns a 500 error:

[root@provider /home1/MyPath/public_html/mysite.com]# grep mysite.com /usr/local/apache/logs/error_log |tail -6
[Sat Sep 20 15:42:16 2014] [error] [client 192.190.1.20] Cannot load the ionCube PHP Loader - it was built with configuration 2.2.0, whereas running engine is API220100525,NTS, referer: http://www.mysite.com/
[Sat Sep 20 15:42:16 2014] [error] [client 192.190.1.20] Zend Optimizer requires Zend Engine API version 220060519., referer: http://www.mysite.com/
[Sat Sep 20 15:42:16 2014] [error] [client 192.190.1.20] The Zend Engine API version 220100525 which is installed, is newer., referer: http://www.mysite.com/
[Sat Sep 20 15:42:16 2014] [error] [client 192.190.1.20] Contact Zend Technologies at http://www.zend.com/ for a later version of Zend Optimizer., referer: http://www.mysite.com/
[Sat Sep 20 15:42:16 2014] [error] [client 192.190.1.20] , referer: http://www.mysite.com/
[Sat Sep 20 15:42:16 2014] [error] [client 192.190.1.20] malformed header from script. Bad header=<br />: index.html, referer: http://www.mysite.com/

This will be because there is a mismatch between the php version being called and the php.ini that is being loaded for the domain. Reviewing the mod_rewrite statements that call the various php versions within the direct file path to your domain shows the following:


[root@provider /home1/MyPath/public_html/mysite.com]# grep -H -A 3 -B 1 'AddHand' /home1/MyPath/.htaccess /home1/MyPath/public_html/.htaccess /home1/MyPath/public_html/mysite.com/.htaccess
/home1/MyPath/.htaccess-# Use PHP52 as default
/home1/MyPath/.htaccess:AddHandler application/x-httpd-php52 .php
/home1/MyPath/.htaccess-<IfModule mod_suphp.c>
/home1/MyPath/.htaccess- suPHP_ConfigPath /opt/php52/lib
/home1/MyPath/.htaccess-</IfModule>
--
/home1/MyPath/public_html/mysite.com/.htaccess-#AddType application/x-httpd-php5 .html
/home1/MyPath/public_html/mysite.com/.htaccess:#AddHandler application/x-httpd-php5 .html
/home1/MyPath/public_html/mysite.com/.htaccess-
/home1/MyPath/public_html/mysite.com/.htaccess-
/home1/MyPath/public_html/mysite.com/.htaccess-##

You would need to also declare the suphp for the php.ini to be used and upload a version matching php.ini to that location. 

I am completely lost as to what this means. I don't even know where to begin. Can someone please help me so I can get my site back to normal?

 

Thank you in advance!

You can try

AddType application/x-httpd-php52 .html .htm .php
AddHandler application/x-httpd-php52 .html .htm .php

if for some reason they are using the Suhosin patch

AddType application/x-httpd-php52s .html .htm .php
AddHandler application/x-httpd-php52s .html .htm .php
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.