47 votes
Accepted

413 “Request Entity Too Large” error with uploading a file

413 errors occur when the request body is larger than the server is configured to allow. Here’s how you can fix it, depending on your web server: Apache: Set the LimitRequestBody directive in either ...
25 votes
Accepted

Why are some entry detail views empty in the control panel?

That error isn't a Craft or PHP error, it's coming from older versions of xDebug. It can happen on more complicated pages (lots of fields, tabs, etc.), but you can get around it by adjusting the ...
  • 66.5k
24 votes
Accepted

FastCGI error when accessing a local development site using MAMP Pro

Following the answer in this issue https://stackoverflow.com/questions/15563217/apache2-fastcgi-comm-with-dynamic-server-aborted-first-read-idle-timeout/15565267#15565267 I was able to successfully ...
  • 356
16 votes
Accepted

How to display a flash message in a template

You can use the setFlash function in the userSession Service like this: In your Controller: craft()->userSession->setFlash('yourVariable', "Something happened yo!"); In your template (that ...
  • 2,824
14 votes
Accepted

500 error on installation since version 2.3

I might be shooting in the sky, but make sure that in your in your .htaccess you have RewriteBase / after RewriteEngine On
12 votes
Accepted

"Craft is unable to determine if an update is available at this time."

You'll get this if (for any reason) your local install can't connect to our web service that holds all of our update and release information. If this happens, your local install will cache that there ...
  • 66.5k
7 votes

Does Craft have an installer error log I can check?

Typically the Craft logs are stored here: /craft/storage/runtime/logs I don't know how much logging the installer does, but if it does any at all, that's where you'll find the log data. In the ...
  • 23.6k
7 votes

PHP Fatal error: Allowed memory size of X bytes exhausted

Craft will run out-of-the-box with 32M of memory, no problem. However, memory consumption will start to increase depending on several factors including: The complexity of your site, including the ...
  • 66.5k
6 votes
Accepted

Template error on local development when checking entry variable

You are close, instead of checking entry|length, you can do {% if entry is defined %} {% if entry is defined and entry.sectionId == 1 %} So if I am understanding correctly, the full code will be: {%...
  • 3,604
6 votes

change the root directory references

The actual web root name doesn’t matter. Usually it’s “public_html” or something similar, and Craft’s “public” folder is only meant to represent that folder. There are no references to the public/...
6 votes
Accepted

Impossible to invoke a method on a null variable

Well, the first method only tries to get an asset model. But if there's no asset added to the field it simply returns null. So calling a method like getUrl, or accessing a property like url or title ...
  • 35.9k
6 votes
Accepted

No input file specified - [proxy_fcgi:error] Got error 'Unable to open primary script: [PATH]/html/index.php (No such file or directory)\n'

It turned out that the problem was from customizing the domain's document root in the userdata files and then the PHP-FPM configuration had not been rebuilt and the service not restarted. The ...
5 votes
Accepted

After updating, getting "Could not resolve the subpath" error

If you're setting an dynamic upload folder location for an Assets field inside of a Matrix field, you need to preface things like {slug} with {owner.slug}. See the note about dynamic subfolders on an ...
  • 66.5k
5 votes
Accepted

How do I clear deprecation errors for looping through element queries?

What about using the all() function as well? Your field doesn't contain an array, it contains the same type of object like craft.entries provides. {% for flag in country.all() %} It doesn't appear ...
5 votes
Accepted

How to duplicate entries and loop them without getting a Twig or deprecation error?

Instead of duplicating the entries, you could run your entries loop twice (or as many times as you want) maybe? {% for i in 0..1 %} {% for entry in entries %} {{ entry.title }} <br&...
  • 7,200
4 votes

Does Craft have an installer error log I can check?

All of Craft's log files get stored in craft/storage/runtime/logs. If you're running in devMode, then any log message with a trace, info, warning or error severity error will get logged there in ...
  • 66.5k
4 votes
Accepted

Craft 2.2 with enabled enableCsrfProtection: Failed to load resource: the server responded with a status of 400 (Bad Request)

I can confirm this is a bug on Craft 2.2.2579 when CSRF protection is enabled. Will get a fix out for it shortly and update this answer when it's done. Update: Fixed in Craft 2.2.2582.
  • 66.5k
4 votes

"Craft is unable to determine if an update is available at this time."

I cleared the cache to no avail. After combing through error logs, I found I had an error with my curl and ssl setup via homebrew. After re-installing those items and reinstalling php55 like so... ...
  • 133
4 votes

Getting "Session Ended" popup in admin

We were experiencing this issue, as well as the randomly logging out issue. As I answered on that question, we fixed both these issues by switching session.auto_start to Off session.auto_start = 0
  • 171
4 votes
Accepted

Plugins page inside CP Settings not working

Sounds like an FTP upload or an unzipping operation didn't finish properly. Try downloading a fresh copy of Craft from http://buildwithcraft.com and replacing the old craft/app folder with the new ...
  • 66.5k
4 votes

PHP Error log in CP gives me 403 forbidden

Had the same problem. I my case, it was the following code in my nginx config file: location ~* (?:\.(?:bak|config|sql|fla|ini|log|sh|inc|swp|dist)|~)$ { deny all; } After removing log| from the ...
4 votes

500 error on installation since version 2.3

In case it helps someone, my issue was the permissions for the root index.php file...It was 666 (writeable by group) and when I switched that file permissions to 644, the installation was able to move ...
  • 61
4 votes

Fatal error: Class 'Craft\FileCache' not found when trying to install

After checking out the craft/app/etc folder, I noticed the cache folder was missing. It turns out that the problem was with my FTP client ignoring folders named "cache". So really a dumb mistake on my ...
  • 346
4 votes

How to move repeating code into an include template

That seo code will need to be in a block of its own. Create a seo block in your _layout template and then wrap your seo code in your include template with block tags of the same name.
  • 249
4 votes

How to move repeating code into an include template

What I do is to handle the metadata in a macro that I call from _layout, which is passed the _context twig global variable In _layout.html: {% import '_macros/_metaData' as m_metaData %} <head>...
4 votes
Accepted

Returning errors into templates

I just return the form model object back to the template. Yii has built in validation and error handling within the models themselves. In the example email is the instance of your form's model. The ...
4 votes
Accepted

Use of undefined constant JSON_HEX_TAG

You're likely missing the PHP JSON extension, which is a requirement to run Craft.
  • 66.5k
4 votes

Craft internal error exposing sensitive data

Your guess is correct... as the docs say, you should never have devMode enabled in production environments specifically for reasons like this (as well as many others). If you find errors that are ...
  • 66.5k
4 votes

An unknown error occurred all the time

I too just had this problem - upon any action in the control panel flashed "An unknown error occurred". What I found in my craft web.log was: "ErrorException: ignore_user_abort() has been disabled ...
  • 91
4 votes
Accepted

'Variable "assetSourceOptions" does not exist' after updating to Craft 2.6

It looks like the Redactor I plugin was incompatible with Craft 2.6... Fortunately, Brandon fixed this last night! Update your version of Redactor I, and the problem should be fixed.

Only top scored, non community-wiki answers of a minimum length are eligible