fopen works in normal PHP but not inside Drupal -


some php code worked well. however, when port code drupal module, $fp = fopen( 'language/unicode-big5.tab', 'r' ); not work expect, giving warning:

warning: fopen(language/unicode-big5.tab) [function.fopen]: failed open stream: no such file or directory in /users/me/documents/html/drupal/sites/all/modules/test_module/language.inc.php on line 197. 

i tried put required files , folder in sites/default/files:

$fp = fopen( file_directory_path().'/language/unicode-big5.tab', 'r' ); 

returns same warning.

how can fix it?

that work fine.

however message stating path wrong, have tried looking @ path it's trying open?

just following, , correct path accordingly.

echo realpath(file_directory_path() . '/language/unicode-big5.tab'); 

if path is correct, need check permissions, user have access file @ all? try chmod 777 , see if helps issue, if does, remove chmod 777 , fix accordingly (user/group permissions).


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -