How to disable APC in Symfony? - symfony-1.4

I'm running a project on Symfony 1.4. Ported it to Windows. Was on a Linux server.
Get this error:
500 | Internal Server Error | sfInitializationException
You must have APC installed and enabled to use sfAPCCache class.
So I know that there is not an easy way to install APC on Windows. I wanna to temporary disable APC in this project. Which files should I change to achieve this ?

Check your factories.yml in apps/yourapp/config. Most probably one of the factories uses the APC cache. You can disable it or try to change to a different cache engine.
According to Sf docs these are the built in cache classes:
sfAPCCache, sfEAcceleratorCache, sfFileCache, sfMemcacheCache, sfNoCache, sfSQLiteCache, and sfXCacheCache
In fact it's not that difficult to install APC on Windows (I managed to do it a while ago ;) ). If you google for "APC cache windows" you can find a few comprehensive instructions on how to do it.

Related

Optimizing symfony 2 in dev environment

Websites in dev environment load in like 10 seconds, which is too much...is there any way to optimize it? I basically have default configuration, didn't change anything...What's wrong here?
The only thing I've tried is to comment out cache loading in app_dev.php, but it didn't work, loading time is still about 10 seconds.
I am running on localhost, nginx.
Thanks!
Use PHP 5.5+ or install some accelerator like APC.
Don't use controller for assetics (documentation).
Profile your application using Xhprof or Xdebug.

Memcache or Memcached installation for Drupal?

I've been floating around the Google and everything's getting more confusing now. What i want to know is how to install Memcache or Memcached. Even which one to install, i'm still not sure. It is super confusing.
I'm on Redhat RHEL. Actually i have installed Memcached (with 'd`) on my Web Server. Then according to the articles, i enabled Php Extension, etc. Then what is supposed to happen? Totally no improvement in performance.
Then i feel thats not enough and i googled again. Some say to install on MySQL Server. So what about PHP Extension and Drupal Module which are supposed to be configured, if i install it on MySQL Server? I'm really not getting it.
So i have Drupal 7 and please let me know in simple way for which is the right one to follow :(
Memcache or Memcached ? (Why this two so confusing?)
Where to put at?
Does it really need Drupal Module to work?
Please simply give me a straight dummy guide :(
"Memcache vs Memcached" - first one is a module (extension), second one is the daemon. See "Memcache Vs. Memcached" for full explanation
"Where to put at?" - you said you had it already installed on your server, it should be installed easily with some package manager e.g.:
pecl install memcache
"Does it really need Drupal Module to work?" - Yes, Drupal needs to know that you want to use memcache. The Drupal module will move cache, sessions and lock tables into memory (see https://drupal.org/project/memcache).
To make memcache module work, you need to put the following into settings.php (change you module path respectively):
# Memcache
$conf['cache_backends'][] = 'sites/all/modules/contrib/memcache/memcache.inc';
$conf['cache_default_class'] = 'MemCacheDrupal';
To see whether it works, go to "admin/config/system/memcache" (this is Drupal 7 path) and turn on "Show memcache statistics at the bottom of each page" - if everything works well, you should see something similar at the bottom of the page:
OPERATION BIN KEY HIT
get cache_bootstrap cache_bootstrap-variables 1

Symfony2 app not works after cache clear

I'm deploying a Symfony2 app in CentOS server with Cpanel.
First time that I execute the app runs well, but the problem comes When I do cache clear, then app not works more, and put this error.
Class "Propa\PageBundle\Entity\Page" is not a valid entity or mapped super class.
To enter in site: http://propa.estudi83.com/app_dev.php/es/empresa/
What Can I do ?
UPDATE: Resolved the problem was eAccelerator, I'm uninstalled eAccelerator and installed APC and works fine!!
Thanks
Regards
It may be a cache optimizer issue. If you are using eAccelerator, then you will have problems, probably with Doctrine. The reason is eAccelerator removes annotations from the code! You can try APC which performs well with doctrine.
Read apc vs eaccelerator vs xcache

Having problems enabling new modules on local Drupal 7 site

I have created a local version of my Drupal website to do dev work on. But when I add new modules to the local version they do install but they do not enable correctly. For example I added the legal module, enabled it, but when I go to site configuration to edit it, the legal section does not appear. Any help please?
The problem is that not enough memory will be allocated to the service to allow for new modules which require more memory to be ran, try putting
ini_set('memory_limit', '256M');
in the sites/default/settings.php file.
This is a really old thread but thought it was worth adding the following.
I had this problem recently on a local dev install (using Acquia Dev Desktop, by the way). Turning off the Memcache module resolved my issue.

Call to undefined function field_attach_load() in my-path-to-root/my-site/includes/entity.inc on line 320

I am moving a site over to a different server to test.
getting this error
Call to undefined function field_attach_load() in my-path-to-root/my-site/includes/entity.inc on line 320
strange... if i try accessing a subdirectry http://www.mysite/randomstuff
i get this error
Fatal error: Call to undefined function user_access() in /home/borsodas3/digipowers.devserver2012.com/modules/overlay/overlay.module on line 130
Fatal error: Call to undefined function node_access_needs_rebuild() in /home/borsodas3/digipowers.devserver2012.com/sites/all/modules/taxonomy_access/taxonomy>_access.module on line 598
here are the two php.info files
going to this server [http://www.freeenergymedia.com/phpinfo-to.htm][1]
from this one [http://www.freeenergymedia.com/phpinfo-from.htm][2]
the drupal status report from the site I am migrating FROM looks like this...
Info
Drupal 7.8
OK
Access to update.php Protected
Error
CTools CSS Cache Unable to create
The CTools CSS cache directory, ctools/css could not be created due to a misconfigured files directory. Please ensure that the files directory is correctly configured and that the webserver has permission to create directories.
OK
Configuration file Protected
OK
Credit card encryption Credit card data is encrypted during checkout for maximum security.
OK
Cron maintenance tasks Last run 26 min ago
You can run cron manually.
To run cron from outside the site, go to mysite.com
OK
Database system MySQL, MariaDB, or equivalent
OK
Database system version 5.1.57-log
OK
Database updates Up to date
OK
Date API System date settings
The timezone has been set to America/New_York. The first day of the week has been set to Monday. The medium date format has been set to to F j, Y - g:ia.
Error
Drupal core update status Not secure! (version 7.12 available)
There is a security update available for your version of Drupal. To ensure the security of your server, you should update immediately! See the available updates page for more information and to install your missing updates.
OK
File system Writable (public download method)
OK
Fitvids library Installed
Fitvids Javascript Library. Download it from here, copy it to the module directory, and rename it to jquery.fitvids.js.
OK
GD library PNG support bundled (2.0.34 compatible)
OK
GD library rotate and desaturate effects bundled (2.0.34 compatible)
OK
Images Product image support has been automatically configured by Ubercart.
Error
Module and theme update status Not secure!
There are security updates available for one or more of your modules or themes. To ensure the security of your server, you should update immediately! See the available updates page for more information and to install your missing updates.
OK
Node Access Permissions 1832 permissions in use
If the site is experiencing problems with permissions to content, you may have to rebuild the permissions cache. Rebuilding will remove all privileges to content and replace them with permissions based on the current modules and settings. Rebuilding may take some time if there is a lot of content or complex permission settings. After rebuilding has completed, content will automatically use the new permissions. Rebuild permissions
OK
PHP 5.3.2 (more information)
OK
PHP extensions Enabled
OK
PHP memory limit 300M
OK
PHP register globals Disabled
Warning
Unicode library Standard PHP
Operations on Unicode strings are emulated on a best-effort basis. Install the PHP mbstring extension for improved Unicode support.
OK
Update notifications Enabled
Info
Upload progress Not enabled
Your server is capable of displaying file upload progress through APC, but it is not enabled. Add apc.rfc1867 = 1 to your php.ini configuration. Alternatively, it is recommended to use PECL uploadprogress, which supports more than one simultaneous upload.
OK
Web server Apache/2.2.3 (CentOS)
OK
cURL Enabled
The first thing I'd do is update to the latest version of Drupal Core. The error message you are seeing is coming from core, but could be from a contrib module. Update all your modules if any are as outdated as your Drupal core is. There are security issues in Drupal 7.8 and other issues which might affect your situation could well have been resolved. The current version of Drupal is 7.12 and a lot has been fixed since Drupal 7.8, which was released about 6 months ago, so you definitely want to upgrade core. Is it also possible that you are running different versions of core on the different machines? If so, the database might not be compatible, especially if you are taking a newer database (more recent modules and core) and loading it into a system with older modules/core.
After also updating other contrib modules and running update.php at appropriate times, if your problem still persists, you might want to use the "divide and conquer" method to identify which module is actually responsible. Remove groups of contrib modules and see where the problem disappears, then narrow it down to which one is causing the problem. It could also be a compatibility issue or configuration problem. Or you might have modules where the code has been updated, but update.php hasn't been run so the database isn't what it should be. You can also use tools such as the Devel module to try to track down issues, but it depends on how "broken" your site is. If you are getting "fatal errors", then you might first want to see what you can do to get past that.
I also notice you need to properly set the permissions/ownership of your files directory so that CSS caching can take place (among other tasks the webserver may be trying to do and which could also be involved in errors you are experiencing), even if not at the root of the "fatal errors".
Hope that helps someā€¦ troubleshooting can be a pain sometimes.
When I installed for the first time, I hadn`t checked "Create new database" and had the same bag but in line 321.

Resources