Ubuntu Zend Framework cli securityCheck Error

2019-07-22 14:53发布

问题:

I followed all the instructions. I am on Ubuntu 10.10. using Zend Server Ce.

In my .bashrc I have ld_library_path, zend framework library, etc.

I can run zf, but its giving an error:

 Fatal error: Uncaught exception 'Zend_Exception' with message 'Security check: Illegal character in filename' in /usr/local/zend/share/ZendFramework/library/Zend/Loader.php:303
Stack trace:
#0 /usr/local/zend/share/ZendFramework/library/Zend/Loader.php(128): Zend_Loader::_securityCheck('Zend/Tool/Proje...')
#1 /usr/local/zend/share/ZendFramework/library/Zend/Loader.php(94): Zend_Loader::loadFile('Zend/Tool/Proje...', NULL, true)
#2 /usr/local/zend/share/ZendFramework/library/Zend/Tool/Project/Context/Repository.php(88): Zend_Loader::loadClass('Zend_Tool_Proje...')
#3 /usr/local/zend/share/ZendFramework/library/Zend/Tool/Project/Context/Repository.php(79): Zend_Tool_Project_Context_Repository->addContextClass('Zend_Tool_Proje...')
#4 /usr/local/zend/share/ZendFramework/library/Zend/Tool/Project/Provider/Abstract.php(85): Zend_Tool_Project_Context_Repository->addContextsFromDirectory('/usr/local/zend...', 'Zend_Tool_Proje...')
#5 /usr/local/zend/share/ZendFramework/library/Zend/Tool/Framework/Provider/Repository.php(187): Z in /usr/local/zend/share/ZendFramework/library/Zend/Loader.php on line 303

If I comment the line Zend_loader 303, it seems to work, but if I try to create controller or something, it's giving an error like below:

[ 21.01.2011 10:26:40 ERROR] [ ZendExtensionManager.cpp : 654 ( sig_handler ) ] ZendExtensionManager got SIG 11 at pid 4781 ! 
[ 21.01.2011 10:26:40 ERROR] [ ZendExtensionManager.cpp : 667 ( sig_handler ) ] Crash happened during IDLE stage 
[ 21.01.2011 10:26:40 ERROR] [ ZendExtensionManager.cpp : 670 ( sig_handler ) ] The stack trace follows: 
[ 21.01.2011 10:26:40 SYSTEM] Obtained 20 stack frames 
[ 21.01.2011 10:26:40 SYSTEM] /usr/local/zend/lib/ZendExtensionManager.so(+0x21c1e) [0xb718fc1e] 
[ 21.01.2011 10:26:40 SYSTEM] /usr/local/zend/lib/ZendExtensionManager.so(+0xf0b7) [0xb717d0b7] 
[ 21.01.2011 10:26:40 SYSTEM] [0xb78d3400] 
[ 21.01.2011 10:26:40 SYSTEM] /usr/local/zend/bin/php() [0x81ccc07] 
[ 21.01.2011 10:26:40 SYSTEM] /usr/local/zend/bin/php() [0x830e044] 
[ 21.01.2011 10:26:40 SYSTEM] /usr/local/zend/bin/php() [0x82e2961] 
[ 21.01.2011 10:26:40 SYSTEM] /usr/local/zend/bin/php(execute+0x212) [0x82e4032] 
[ 21.01.2011 10:26:40 SYSTEM] /usr/local/zend/lib/debugger/php-5.3.x/ZendDebugger.so(+0x4bed6) [0xb2c72ed6] 
[ 21.01.2011 10:26:40 SYSTEM] /usr/local/zend/bin/php() [0x830daef] 
[ 21.01.2011 10:26:40 SYSTEM] /usr/local/zend/bin/php() [0x82e2961] 
[ 21.01.2011 10:26:40 SYSTEM] /usr/local/zend/bin/php(execute+0x212) [0x82e4032] 
[ 21.01.2011 10:26:40 SYSTEM] /usr/local/zend/lib/debugger/php-5.3.x/ZendDebugger.so(+0x4bed6) [0xb2c72ed6] 
[ 21.01.2011 10:26:40 SYSTEM] /usr/local/zend/bin/php() [0x830daef] 
[ 21.01.2011 10:26:40 SYSTEM] /usr/local/zend/bin/php() [0x82e2961] 
[ 21.01.2011 10:26:40 SYSTEM] /usr/local/zend/bin/php(execute+0x212) [0x82e4032] 
[ 21.01.2011 10:26:40 SYSTEM] /usr/local/zend/lib/debugger/php-5.3.x/ZendDebugger.so(+0x4bed6) [0xb2c72ed6] 
[ 21.01.2011 10:26:40 SYSTEM] /usr/local/zend/bin/php() [0x830daef] 
[ 21.01.2011 10:26:40 SYSTEM] /usr/local/zend/bin/php() [0x82e2961] 
[ 21.01.2011 10:26:40 SYSTEM] /usr/local/zend/bin/php(execute+0x212) [0x82e4032] 
[ 21.01.2011 10:26:40 SYSTEM] /usr/local/zend/lib/debugger/php-5.3.x/ZendDebugger.so(+0x4bed6) [0xb2c72ed6] 
Segmentation fault

How can I solve this problem?

回答1:

I understand how the error occurred.

My operating system using utf8 character encoding for file names. utf8-encoded file names with the php is run by the terminal gives the error. 'I' is the upper one 'ı' in my language. But php expects to be 'i'. If i change the file names to ASCII in php using iconv , error happens again because it cant find the location of the file at this time. I found the cause of the problem but still do not know the solution.

Thank you.



回答2:

I believe this is not ZF issue. This is either php bug or misconfiguration.

replace in Zend_Loader and post here output so i can confirm my suspicion

protected static function _securityCheck($filename)
{
    var_dump($filename); exit;
}

Also try this:

mb_internal_encoding('UTF-8');
mb_regex_encoding('UTF-8');

Sorry if i'm wrong. I'm not an expert here.



回答3:

In zf.sh you must add just before if test "@php_bin@" != '@'php_bin'@'; then line,

LANG=C
export LANG

Everything is working now, and i am happy...