PDA

View Full Version : Solved Upgraded to PHP 5.2.14 - Some languages are broken



moman
17-08-10, 18:51
I've recently had my server upgraded to PHP 5.2.14. Currently, memcached is still down, so some functionality isn't working in my other add-ons, but it looks like vBET is.

However, only a few languages are currently working!

Danish works: PentaxForums.com - Pentax Photography Forum (http://www.pentaxforums.com/forums/da/)
Polish doesn't: http://www.pentaxforums.com/forums/pl/

This notice is shown on all forum pages:
Notice: Use of undefined constant DIR - assumed 'DIR' in ************************************************************************************************************************../forums/includes/vbenterprisetranslator_functions_vbseo.php on line 18

If I change this code in the vbet functions_vbseo file:
if (!defined(DIR)) {
define('DIR', (($getcwd = getcwd()) ? $getcwd : '.'));
}
to just
define('DIR', (($getcwd = getcwd()) ? $getcwd : '.'));

the warning disappears, but my problem isn't fixed. Any idea why this would be? FYI, there are no notices or errors currently being shown on the vBET pages.

I copied and am still using my old php.ini file, so the same settings are being used as before.

Thanks for your help!

Adam

moman
17-08-10, 19:02
Update- the languages that I thought worked only appear to be working on the homepage! Try to open a thread when logged in as a member (username testuser, password test); it'll show a blank white page.

Pentax DSLR Diskussion - PentaxForums.com (http://www.pentaxforums.com/forums/da/pentax-dslr-discussion/)

moman
17-08-10, 19:41
Could the problem be with curl or iconv? They are on in PHP, but might not be working properly as a result of the upgrade. Is there any way to check this?

moman
17-08-10, 19:55
I have some further insight on the issue-

Only pages that can be fully fetched from cache are being shown. I tried disabling the cache for Danish, and then no pages were showing up.

moman
17-08-10, 22:32
One more observation:

This code from my homepage previously successfully included a file (which still works if you open the url direcly), while after the upgrade it did nothing:


<?php include('http://www.pentaxforums.com/content/homepage/rss/rss2html.php?XMLFILE=http://www.pentaxforums.com/forums/external.php?forumids=24,37'); ?>

I had to add allow_url_include = On to php.ini, and then it worked. Perhaps some other required parameter for vbet is missing from the configuration file?

moman
17-08-10, 23:00
And a final update before I go to bed for the night:

I switched a setting in Plesk so that PHP is now run as a cgi application. This made the translations work again; however, when I switch back to running it as an apache module, evertything breaks again, and translated pages give 500 errors. Any ideas?

kamilkurczak
18-08-10, 08:48
As you wrote: now translation is working again? vBET is working?
Did you turn on your CURL?
500 error - this is an error between apache and server - may be a wrong apache and server configuration? can you paste here your .htaccess?

moman
18-08-10, 10:15
It's working, but only when PHP runs as a CGI script, and not as an apache module.

Here is my .htaccess:
# Comment the following line (add '#' at the beginning)
# to disable mod_rewrite functions.
# Please note: you still need to disable the hack in
# the vBSEO control panel to stop url rewrites.
RewriteEngine On

# Some servers require the Rewritebase directive to be
# enabled (remove '#' at the beginning to activate)
# Please note: when enabled, you must include the path
# to your root vB folder (i.e. RewriteBase /forums/)
#RewriteBase /

#RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com
#RewriteRule (.*) http://www.yourdomain.com/forums/$1 [L,R=301]

RewriteRule ^((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]

RewriteRule ^/?(af|sq|ar|be|bg|ca|zh-CN|hr|cs|da|nl|et|tl|fi|fr|gl|de|en|el|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sw|sv|zh-TW|th|tr|uk|vi|cy|yi)/$ vbenterprisetranslator_seo.php?vbet_lang=$1&redirected=/forums/ [L,QSA]

************---

Even when I ran php as an apache module, individual translations were working- so if I made a post using langtitle tags, it would get translated. However, untranslated pages, i.e. mysite/pl/thread.html, that couldn't be found in the cache simply generate blank white pages.

It would be nice if we could track down the cause of this, as I have a feeling that something more serious is causing this to begin with.

kamilkurczak
19-08-10, 08:50
This is your all .htaccess rules? or only part of this file? do you use vBSEO?

I was on your site as testuser, post a test message, translate to polish, japan etc. and this is working.

As I wrote in previous post - this is issue between php and apache. This issue is caused by wrong server configuration. You can write to your host provider and ask about good configuration. He must to check it.

moman
19-08-10, 12:13
Yup, that's it for the .htaccess inside the forums.

I've contacted my host and they insist that the server is properly configured, but I've also read that CentOS only natively supports PHP 5.1.6. I guess I'm hosed untill I hire a server management company and migrate to a new OS.

Thanks for your help.

kamilkurczak
19-08-10, 18:08
ok, so if you will need help again - write here

AfrikaansAlbanianArabicBelarusianBulgarianCatalanChineseCroatianCzechDanishDutchEnglishEstonianFilipinoFinnishFrenchGalicianGermanGreekHaitian CreoleHebrewHindiHungarianIcelandicIndonesianIrishItalianJapaneseKoreanLatvianLithuanianMacedonianMalayMalteseNorwegianPersianPolishPortugueseRomanianRussianSerbianSlovakSlovenianSpanishSwahiliSwedishTaiwaneseThaiTurkishUkrainianVietnameseWelshYiddish
Integration with Google translations by vB Enterprise Translator 4.9.99