Troubleshooting

URLs vs. Paths

The first thing you need to understand when working with PHP and images is this: PHP uses server paths (for example: /var/www/example/domain/public/), not URLs (like http://www.example.com). CE Image tries to blend the two to make life easier. This is what makes CE Image work out-of-the-box for most people. However, there are times when you may need to adjust some settings to get things to work for your specific setup.

Debugging

If you are having any trouble getting the plugin to work, you need to enable ExpressionEngine®’s Template Debugging. If you don’t do that, then you don’t really want to solve your issue. Seriously, do it! :)

Enabling Template Debugging for EE2

In EE2, you can enable template debugging in the Super Admin Control Panel by going to Admin->System Administration->Output and Debugging->Display Template Debugging?->Yes.

Enabling Template Debugging for EE1

In EE1, you can enable template debugging in the Super Admin Control Panel by going to Admin->System Preferences->Output and Debugging Preferences->Display Template Debugging?->Yes.

Meet The Template Debugger

Now refresh your page and scroll down. You will see an ugly gray box with black text in it. You have just met the template debugger! The template debugger is awesome, because it shows you what is happening on the page, and how long things are taking. It’s a very important tool for getting your site to run smoothly.

You will want to do a quick search on the page for CE Image debug. The plugin logs some detailed info about what’s going on, and you will be able to tell what problems, if any, it encounters.

Debugger Example

In this example, we are going to add a CE Image single tag to a blank template, and pass in a source image that doesn't exist:

<!-- Note that the source image doesn't exist -->
{exp:ce_img:single src="images/example/not_real.jpg"}

In the debugger, we will see information about this tag in two places. Towards the top of the debugger output, we see that EE found the tag. This is a good place to see exactly the way EE is receiving your tag:

(0.022897 / 5.91MB) Parsing Tags in Template
(0.022935 / 5.91MB) Tag: {exp:ce_img:single src="images/example/not_real.jpg"}
(0.023005 / 5.91MB) No Closing Tag
(0.023046 / 5.91MB) Processing Tags
(0.023083 / 5.91MB) Plugin Tag: Ce_img/single

Then a little later on, we see that EE is calling the plugin to process your tag. This is where we will get back the useful debug messages. They will start with *** CE Image debug:

(0.026034 / 6.16MB) Calling Class/Method: Ce_img/single
(0.026140 / 6.16MB) -> Class Called: Ce_img
(0.026170 / 6.16MB) -> Method Called: single
(0.038385 / 7.17MB)   ***  CE Image debug: Base path: '/your/current/document/root/'
(0.038408 / 7.17MB)   ***  CE Image debug: Source image: 'images/example/not_real.jpg', Fallback image: ''
(0.038429 / 7.17MB)   ***  CE Image debug: Source image is not readable or does not exist: 'images/example/not_real.jpg'.
(0.038442 / 7.17MB)   ***  CE Image debug: Fallback source image is not readable or does not exist: ''.
(0.038471 / 7.17MB) Returning No Results Content
(0.038555 / 7.16MB) -> Data Returned

The above means that CE Image looked for your image at /your/current/document/root/images/example/not_real.jpg (the “base path” plus the relative path), but it wasn’t there (or was not readable)!