I have deployed drupal site on my dev env and I can view the frontend of the site. The Site pages are cached using APC server cache module installed on drupal.
The Issue is that I'm not able to clear the cache using Admin Console of Drupal CMS because after login I get the error -
Fatal error: Call to undefined function apc_delete() in C:\xampp\htdocs\nrdrupaldev\sites\all\modules\apc\drupal_apc_cache.inc on line 289
As the Admin is not accessible due to the above error I tried to disable the module directly from the Database using this query -
UPDATE system SET status='0' WHERE name='apc'
After this I also disabled the module from settings.php by removing its config settings.
But this gave me a series of errors and warnings see below image ![enter image description here][1]
First thing to check is your PHP version. APC no longer works in PHP 5.5+ so you will need the APCu extension.
If you are getting an error stating that a function that belongs to APC is not defined it's safe to say that the extension is not being loaded.
I have not used the APC Drupal module for some time as I has switched my caching needs to Redis but I believe it was updated to support APCu.
Related
I am using Rest Routes plugin for building custom endpoints for WP Rest API. This plugin is tested for compatibility for upto WordPress versioin 4.5.9. I'm using WordPress version 4.6.6 on my localhost and the plugin works fine. I'm able to create custom endpoints. But when I install this plugin in the live server, where I'm using the same version of wordpress, 4.6.6, the plugin doesn't get activated, showing me an error:
Parse error: syntax error, unexpected '[' in /nfs/c07/h03/mnt/109306/domains/lrp.magikbox.biz/html/wp-content/plugins/rest-routes/inc/filters/wprr-filter-post_type.php on line 92
The error is generating from $post_type_arr = []; raised by [ of post type filter. It seems the Array Initialization Construct: [] is the cause of the error. I tried recreating your error with my production server running PHP 7 but Rest Routes activated successfully. I have checked your website: http://lrp.magikbox.biz/ it runs on PHP 5.3.29, sadly short Array Initialization Construct [] only works for PHP 5.4+ - see here.
Check your development server (your localhost) it is certainly running PHP 5.4+. As a solution either consider changing your host to one that supports PHP 5.4 and above or use WP Rollback plugin and roll back the plugin to its early 2014 version when PHP 5.3.29 was released.
I had purchased the collective theme yesterday from themefuse and when i uploaded the theme i got the following error:
Warning: session_start() [function.session-start]: Cannot find save handler 'memcache' - session startup failed in /home/makingfa/public_html/wp-content/themes/collective-parent/framework/core/SESSION.php on line 24
Warning: session_start() [function.session-start]: Cannot find save handler 'memcache' - session startup failed in /home/makingfa/public_html/wp-content/themes/collective-parent/framework/core/SESSION.php on line 24
I contacted the themefuse support and they responded as follows:
"Please clear your browser cache and try one more time."
I cleared my browser cache both in Firefox and in IE but i still get the same error. Further i installed the WP Super Cahche plugin and deleted the cache via the plugin but again the error remains.
I am relatively new the WordPress and not sure if i am missing something here. Any help or info would be greatly appreciated as Themefuse support are not responding.
Many thanks
My site is http://www.makingfans.co.uk
You don't appear to have the memcache package installed, or at least not enabled. Is this a server that you control? Supercache, among other things can persist some things to a memcache server, but if you haven't got it installed, then you can't use it.
The same applies to saving sessions into memcache - unless it's setup and running, you can't use it. If you do have access to edit php.ini, or if its within Wordpress, then for now, you have to turn it off and just go back to
session.save_handler = files # in php.ini, or maybe set in a .htaccess
I have just updated a site that is using Drupal and have now experienced the horrible WSOD.
I have searched through Google looking for any sort of solution/error log to help me find and fix the issue but nothing has worked. I have tried adding in the 'display errors' code in the index.php file and looked at the error_log file in the public directory and nothing.
I can not login to the admin page and check any modules as the login page for this is returning a 403 error.
Any suggestions?
Please go to Apache Error log. You will exact error messages there.
The log file's location is different for different OS and versions.
e.g httpd/log/error.log
Maybe your Drupal registry is broken.
Fix this using the registry_rebuild script (this is no module!)
There are times in Drupal 7 when the registry gets hopelessly hosed and you need to rebuild the registry (a list of PHP classes and the files they go with). Sometimes, though, you can't do this regular cache-clear activity because some class is required when the system is trying to bootstrap.
You might get something like:
PHP Fatal error: Class 'EntityAPIControllerExportable' not found in ...sites/all/modules/rules/includes/rules.core.inc on line 11
If this happens when you're trying to run update.php, and happens when you're trying to clear your cache, well, you have some trouble. That's what Registry Rebuild is for.
It also may happen that you've moved some module that Drupal requires to bootstrap, and you get a horrible error. Registry Rebuild will also rebuild the system table to get the modules in the right place so you can bootstrap.
You will need PHP-CLI or drush to run this.
https://drupal.org/project/registry_rebuild
How can I check Drupal log files?
I'm using Ubuntu 10.10 + Apache2 + PHP 5.33 + MySQL and Drupal 7.
To view entries in Drupal's own internal log system (the watchdog database table), go to http://example.com/admin/reports/dblog. These can include Drupal-specific errors as well as general PHP or MySQL errors that have been thrown.
Use the watchdog() function to add an entry to this log from your own custom module.
When Drupal bootstraps it uses the PHP function set_error_handler() to set its own error handler for PHP errors. Therefore, whenever a PHP error occurs within Drupal it will be logged through the watchdog() call at admin/reports/dblog. If you look for PHP fatal errors, for example, in /var/log/apache/error.log and don't see them, this is why. Other errors, e.g. Apache errors, should still be logged in /var/log, or wherever you have it configured to log to.
If you love the command line, you can also do this using drush with the watchdog show command:
drush ws
More information about this command available here:
https://drushcommands.com/drush-7x/watchdog/watchdog-show/
Make sure drush is installed (you may also need to make sure the dblog module is enabled) and use:
drush watchdog-show --tail
Available in drush v8 and below.
This will give you a live look at the logs from your console.
We came across many situation where we need to check error and error logs to figure out issue we are facing we can check by possibly following method:
1.) On blank screen
Some time we got nothing but blank screen instead of our site or message written The website encountered an unexpected error. Please try again later , so we can Print Errors to the Screen
by adding
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
in index.php at top.;
2.) We should enable optional core module for Database Logging at /admin/build/modules, and then we can check logs your_domain_name/admin/reports/dblog
3.) We can use drush command also to check logs
drush watchdog-show it will show recent ten message
or if we want to continue showing logs with more information we can user
drush watchdog-show --tail --full.
4.) Also we can enable core Syslog module this module logs events of operating system of any web server.
We can use drush command also to check logs
drush watchdog-show it will show recent 10 messages.
or if we want to continue showing logs with more information we can user
drush watchdog-show --tail --full.
MAMP/logs/php_error.log
Above all given option does not work go to the MAMP/logs/ check all type of log-like.
mysql_error.log
nginx_error.log
apache_error.log
For drupal 9, you can access to your logs with drush , here some commands:
watchdog:delete (wd-del, wd-delete, wd) Delete watchdog log records.
watchdog:list (wd-list) Interactively filter the watchdog message listing.
watchdog:show (wd-show, ws) Show watchdog messages.
watchdog:show-one (wd-one) Show one log record by ID.
watchdog:tail (wd-tail, wt) Tail watchdog messages.
One more thing if your are not fan with commands, please in the Administrative menu, go to Reports > Recent log messages. On this page is a list of recent log messages which you can filter by type and severity.
but if your are professional you can configure ELK that's will give you all
In Drupal, you can check the log files through the Drupal admin interface or by accessing the server files directly. Here are the steps for each method:
Through the Drupal admin interface:
Log in to your Drupal site as an administrator.
Go to Reports > Recent log messages.
This will show you a list of recent log entries, filtered by severity level and type.
By accessing server files:
Connect to your server via FTP or SFTP.
Locate your Drupal installation directory.
Look for the "logs" directory or server level /var/log.
Open the log files you want to view.
Note: The location of the log files may vary depending on your Drupal installation and server configuration. You may need to consult your hosting provider or server administrator for help finding the logs.
I'm developing a site in Drupal 6, and I'm going mad trying to work out why pages (specifically pages containing views), I'm working on locally are caching content instead refreshing the contents of the page, and that of linked js files, I'm relying on for making a mashup - is there a checklist I can check against to be sure I'm not missing when trying to deactivate caching?
These are the steps I'm taking:
On the server:
set the site to rebuild the theme on each load
cleared cache using drush (as in drush #dev cc all`) on each page load
checked that the json output from a view isn't caching
disabled any css or js caching in admin/settings/performance
On Firefox/firebug
using the web developer extension, disabled the cache
been refreshing the site using shift-F5 to force a clear of the cache
I'm not using varnish or memcached, nor any other caching modules like boost - it's straight Apache-PHP through to Drupal and MySQL.
What am I missing here?
The three things you need to do are:
Go to Site Configuration -> Performance:
Set the following options, and click Save configuration:
Caching mode: Disabled
Minimum cache lifetime: none
Page compression: Disabled
Block cache: Disabled
Optimize CSS files: Disabled
Optimize JavaScript files: Disabled
Click Clear cached data.
Go to Site building -> Views -> Tools:
Check Disable views data caching and click Save configuration.
Click Clear Views' cache.
Install the Devel module, and go to Site Configuration -> Devel settings:
Check Rebuild the theme registry on every page load and click Save configuration.
This will make sure all registries and caches except for the menu router will be rebuilt on every page, effectively preventing caching in practice.
If you really need the menu router to be rebuilt on every page (it's completely unnecessary, as you only need to worry about it when you change your implementation for hook_menu() or hook_menu_alter()), you could add menu_rebuild() to hook_init() in a custom module:
function mymodule_init() {
menu_rebuild();
}
First you don't need to do drastic things like clear cache using drush #dev cc all on each page load. Also you really don't need to have the theme registry get built on every page load unless you're doing some theme development
Make sure that page caching is set to disabled at /admin/settings/performance
Make sure you don't have some funny .htaccess rules in your drupal site and your .htaccess is the default one that comes with drupal. You might want to make sure the headers for html files generated by Drupal have an expiry in the past and the html has no-cache in the header.You have already clarified you're not using boost, varnish, memcached. It might be a good idea to make sure mod_expires apache module is enabled also.
Make sure in each view under Basic Settings Caching is set to None [I suspect this might be a source of your views not updating]
Are you using windows? If so its not the best environment for apache + PHP and I'll recommend you install Ubuntu 9.10 or an earlier in VirtualBox (Recommending Ubuntu 9.10 or earlier as it has PHP 5.2. PHP 5.3 is not very well supported by Drupal). You can use the seamless mode -- its really very cool.