Zend Translate Component - Blank page - no framework website

328 views Asked by At

I'm trying to add Zend Translate component into a very basic no-framework website (since gettext is giving me headaches in shared hosting environment)

What I did is copy the library directory of the framework into the root directory of my site (i.e. $RootDirectory/Zend/*) and added this to a script that is included in all my pages:

require('Zend/Translate.php');    
$translate = new Zend_Translate(
    array(
        'adapter' => 'gettext',
        'content' => 'path/to/mo',
        'locale' => $myLocale
    )
);

and of course replaced all

_('text') 

with

$translate->_('text')

In my local environment is working with no problems. On the production server is displaying a blank page on all links.

I've tried suggestions related to setting error_reporting and display_errors with no luck. Memory_limit is the same on both servers.

Can someone help me get an error out of that blank page?

Thanks

2

There are 2 answers

2
therealjeffg On

Your production server is logging that error somewhere, for example by default on Ubuntu the errors get logged here:

/var/log/apache2/error.log

The simplest technique is to use the tail utility:

  1. log into the machine
  2. run sudo tail -f /var/log/apache2/error.log
  3. Hit refresh on the page again

You should see the PHP error printed out to the terminal Window.

Note that I've made some assumptions about your production server configuration, YMMV.

0
Mecca On

Could not figure out how to display the errors but figured out what was causing them.

Filezilla was sending the mo files in ASCII instead of Binary.