vTiger Cron – Access Denied

By default, vTigerCRM allows you to import up to 1000 contacts/leads. If you try to import more than that, the task will be scheduled to run via the vTiger Cron.

Here is the tricky part – the cron rarely works on default installations. It does not seem to be well documented and maintained. Usually when you set it and run it, all you will get is “Access Denied!”. The error message has nothing to do with file permissions.

There is a good solution, that works in some cases – i.e. if you are running Apache. Here it is!

First you need to determine your php_sapi value. Here is a simple script that will show you what you are using on your hosting account or server configuration:

You just to run this php script in your browser and it will show you a value. Copy the output and open your vtigercron.php file for edit on your vTigerCRM installation. Look at the 42nd line:

if(PHP_SAPI === “cli” || (isset($_SESSION[“authenticated_user_id”]) && isset($_SESSION[“app_unique_key”]) && $_SESSION[“app_unique_key”] == $application_unique_key)){

and replace “cli” with what you got for your sapi_type.

Now the cron should work well, unless your Webserver is litespeed. If this is the case, the fix above is not applicable, so a simple workaround would be to either import your data in batches, or edit this file:

~/modules/import/config.inc

The line is 22 and you can specify the number of entries that you want to import without running it as a cron.

You can bump that up, increase your memory_limit, max_execution_time etc. and avoid the troublesome cron.

Good luck!

An article by -


Always willing to learn new concepts and skills not only in the area of Internet and computers. Working as a Linux System Administrator.


0 comments… add one

Leave a Comment