By jeremycameron on
Getting an error
Fatal error: Call to undefined function: user_access() in /big/dom/{username}/www/drupal/includes/common.inc on line 1921
Any help would be appreciated.
Getting an error
Fatal error: Call to undefined function: user_access() in /big/dom/{username}/www/drupal/includes/common.inc on line 1921
Any help would be appreciated.
Comments
Zend/IONCube?
See http://drupal.org/node/26256
Perhaps you could tell us a little more?
--
Tips for posting to the forums
Followup
What further information are you looking for? This is a fresh install on a hosted website in which we are attempting to use Drupal as our CMS. I followed the installation instructions provided by Drupal and attempted to access the site and got the error above. I'm a little fuzzy on the resolution in the thread you linked in your reply or if there even was a resolution.
As much info as you have
As much info as you have available.
From Tips for posting to the forums
The cause of the problem for one poster was the deletion of all modules in the modules directory. Since you have a fresh install this isn't it I guess.
Another cause of the fatal error discussed in the thread I linked to is an incompatablity with Zend Optimizer or IONCube (both PHP optimizers). These optimizers cause erratic behaviour of foreach loops (returning arrays instead of single array elements). This depends on the php and optimizer version.
To see if such optimizers are enabled, paste the following into a file e.g. 'info.php' and upload it to your server. Then use your favorite browser to go to http://example.com/info.php
info.php:
The key phrases from the thread I linked to:
--
Tips for posting to the forums
Environment Info
Here is the info you requested:
OS: Linux
Apache v1.3.33
Zend Optimizer v2.5.7
php v4.3.10
latest ver of drupal
user.module not loaded
Apparantly user.module is not loaded.
Check that all files are properly uploaded (user.module should be in modules), and that Apache has read access to the modules directory. Also check in the database that the status column of the "system" database table for user.module is set to 1.
To see if it's a foreach() optimizer problem (phpaccellerator, zend optimiser, ioncube) you can use the following code in afile.php (or disable all optimizers)
Load http://example.com/afile.php. When foreach() works properly this should print
--Some background--
Common.inc calls user_access after calling module_init()
module_init is located in module.inc and calls module_load_all:
See for even more background http://drupal.org/node/10858
--
Tips for posting to the forums
Still not working
* The user.module is uploaded and in the correct directory.
* Apache has rw access to the dir.
* The foreach() function works properly.
* All values in system table are set to '1'
We are still getting the same error. Any further help would be appreciated.
Sorry
Sorry, what I meant to say is that the Apache user needs to be able to read the module. Make sure this user has the execute permission on all directories.
--
Tips for posting to the forums
Any other ideas?
The Apache user has full permissions on all directories in the Drupal instance.
Do you have any other ideas as to what may cause this issue?
Your afile.php example fails for me
I am having similar problems, and your afile.php example FAILS for me. Here is the output of your afile.php example:
Just to be sure, I will go copy and paste the source code of afile.php:
So, does this mean I should disable Zend?
Here is my info:
__________
Matthew Doucette / Xona.com™
Yes - How to disable Zend Optimizer
Yes, though no garantue it will solve your problem, it's the best bet.
To disable Zend, locate your php.ini file, open it and comment all zend_ variables with a semi-colon.
Example
Restart Apache after the edit.
Good luck!
--
Tips for posting to the forums.
When your problem is solved, please post a follow-up to the thread you started.
I don't have access to php.ini!
Thanks, but no luck for me. I do not have access to the php.ini file! I was hoping for another method of disabling it, as I do not have access to server configuration files.
__________
Matthew Doucette / Xona.com™
Ask your host
If you do not control the server, contact your host and explain your problem.
Symptom: Drupal fails with a fatal error, because an essential module is not included.
Immediate cause: PHP statement
foreachreturns arrays instead of array items.Diagnosis: Most likely a problem / incompatability between PHP and a PHP accelerator (eg Zend optimizer).
--
Tips for posting to the forums.
When your problem is solved, please post a follow-up to the thread you started.
Installing Zend Optimizer Hard?
Is installing Zend Optimizer a difficult thing to do? It seems quite easy based on these instructions:
http://www.zend.com/content/download/490/1981/file/ZendOptimizer_UserGui...
Just wondering how big a deal it would be to do it myself... with my inexperience that is... Everything's always easy right until things go wrong and you don't have the experience to bail yourself out! :)
Anyways, it looks extremely automated.
__________
Matthew Doucette / Xona.com™
It's about rights
Installing is not very difficult, but I doubt you have sufficient rights on the server to do so.
--
Tips for posting to the forums.
When your problem is solved, please post a follow-up to the thread you started.
Zend Extension 20021010 is quite old...
Zend Extension 20021010 does seem quite old. Assuming Drupal DOES work with ZendOptimizer, I should get my host to upgrade.
Is Drupal known to have problems with older versions of ZendOptimizer?
__________
Matthew Doucette / Xona.com™
Optimizer & PHP, not drupal
When basic PHP language constructs such as foreach() do not work properly I think it's safe to say it's a problem with PHP & Zend Optimizer, not with Drupal.
--
Tips for posting to the forums.
When your problem is solved, please post a follow-up to the thread you started.
Exactly.
Exactly. I agree. I did not mean to blame Drupal... I was just questioning whether it is know to work with ZendOptimizer's older versions. ZendOptimizer is obviously flawed and the cause of at least one problem on my server.
__________
Matthew Doucette / Xona.com™
Don't worry
Drupal works on php + zend optimizer, but only when those two are compatible. Your host probably upgraded php, but forgot to upgrade the optimizer as well (happened twice on one of my hosts).
--
Tips for posting to the forums.
When your problem is solved, please post a follow-up to the thread you started.