简体   繁体   中英

Zend Translate Component - Blank page - no framework website

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 (ie $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

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM