Fuel Documentation

Troubleshooting

Fuel supports a wide variety of configurations. Sometimes the configuration needs some work in order to work properly. Listed below are a couple of scenario's that may pop up when setting up Fuel on your machine.

When your problem is not listed below or is listed but no proper solution is provided, please report this at the issue tracker ( http://dev.fuel.com ).

Syntax errors with clean installation

Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /Users/info/Sites/fiuel/public/index.php on line 9

Happens When...

When running Fuel on a PHP version prior to 5.3.

Solution

Check the phpinfo(); in a seperate testfile and see if you're running 5.3 or higher. More info on requirements is here.

When developing locally, update your server to the latest version of PHP 5.3. If you are not developing locally you'll need to ask your hosting company. Versions of PHP below 5.3 have lost support not just by us, but by PHP themselves.

Got it working, but the index page is a 404.

Happens When...

On some php installations it's needed to add a questionmark in the .htaccess after index.php

Solution

Add the questionmark like so:

# Turn on URL rewriting
RewriteEngine On

# Installation directory
RewriteBase /
# If fuel is not a level up
# RewriteBase /public

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php?/$1 [L]
# Notice the ? after index.php

Some fcgi installations require a variant of this solution:

RewriteRule ^(.*)$ index.php?$1 [L]
# Notice the fact that the slash has been removed after the ?

Oil cannot connect to DB but application can

mysql_connect(): [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) in /Users/phil/Sites/fuel/fuel/core/classes/database/mysql/connection.php on 73

Happens When...

Happens when you try to interact with the database via the command line, often when using MAMP for your MySQL server. The reason for this is that PHP-CLI is a different installation to the MAMP provided by MAMP, so PHP knows nothing of the database server.

Note: Before performing the following step to fix the problem, verify the database connection via normal browser access.

Solution

Change "localhost" to "127.0.0.1" in your database.php

Failing that:

Create a symlink pointing at MAMP's mysql.socket.

$ sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock

In some cases you have to create the directory first:

$ sudo mkdir /var/mysql
$ sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock

Orm\Exception [ Error ]: Listing columns not failed

Error

Orm\Exception [ Error ]: Listing columns not failed, you have to set the model properties with a static $_properties setting in the model.

Happens When...

Working with ORM models when not connection via mysql.

Solution

Make sure the db config values are correct and test you database connection.

Update the model to contain the properties.

protected static $_properties = array('id', 'title', 'contents', 'publish');

Or set the change the db type to "mysql" in APPATH/config/db.php

Assets do not work after changing the location of index.php

Solution

That is because Asset class uses relative path to index.php.

To fix that you have to modify the app/config/asset.php to set the correct path. Notice in index.php that a constant named DOCROOT is being defined:

define('DOCROOT', __DIR__.DIRECTORY_SEPARATOR);

You can use that in app/config/asset.php. This will set the asset path back to the default folder DOCROOT/public/assets, where the subfolders for css/ img/ and js/ are located:

'paths' => array(DOCROOT.'public/assets/'),