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

Issue Type: Bug Created: 2009-02-19T09:43:12.000+0000 Last Updated: 2009-02-19T11:17:09.000+0000 Status: Resolved Fix version(s): - 1.7.6 (02/Mar/09)

Reporter: Jordi Cerdan (jcerdan) Assignee: Thomas Weidner (thomas) Tags: - Zend_Locale

Related issues: Attachments:


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'; ...


Posted by Thomas Weidner (thomas) on 2009-02-19T10:00:13.000+0000

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.

Posted by Thomas Weidner (thomas) on 2009-02-19T10:09:18.000+0000

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

Posted by Jordi Cerdan (jcerdan) on 2009-02-19T11:09:19.000+0000

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.

Posted by Thomas Weidner (thomas) on 2009-02-19T11:17:07.000+0000

Closed as non issue. Configuration problem.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.