ZF-5843: Locale files are not found on the system but they are really there


Creating a new date with Zend_date throws an exception about missing locale files:

Ex: $myDate = new Zend_Date("2009-02-03");

results in: Fatal error: Uncaught exception 'Zend_Locale_Exception' with message 'Missing locale file '/usr/local/php5/lib/php/Zend/Locale/Data/ca.xml' for 'ca' locale.

Zend framework libraries are found under /usr/local/php5/lib/php/Zend/... Had a look to the server, and the files are really there so I suppose it's trying to load the xml file from somewhere else.

If I upload the Zend Libraries to my project, for example: /home/myProject/library/Zend/... then this works fine. and the new date is ok.

So, I think there's a problem in Locale/Data.php, in concrete, in line 140 when the function _findRoute( .. ) tries to load the locale xml file. ... $filename = dirname(FILE) . '/Data/' .$locale . '.xml'; ...


No there is not.

As you note: $filename = dirname(FILE) . '/Data/' .$locale . '.xml'

dirname is the directory where Data.php resists. Subdir Data and the file ca.xml.

You way that the file is there, and Zend_Locale says that it can not read the file.

Maybe both is true. Still, this is no problem is Zend_Locale but a file system, privilege or php settings problem.

What I wanted to say it, that when it works on one server but not on the second simply check the settings.

Okay, stupid me, I have disabled temporarily safe_mode and now the script is running fine.

So the problem is the function file_exists() with safe_mode activated.

Even if I have safe_mode_include_dir = .:/usr/local/php5/lib/php

I get this error.

So I did: cd /usr/local/php5/lib/php/Zend/Locale chown -R www-data Data

And that solved the problem.

Thanks for your help, I think you can mark this as solved and may be this detail about safe mode (even it'll be removed in PHP 6) should be mentionned in the install instructions.

Kind regards.

Closed as non issue. Configuration problem.