Skip to content

The Dummy Programmer

Stories of daily programming

  • Home
  • The Dummy Programmer Robot
    • Overview
    • Version history & downloads
    • Tutorials
      • TDP Robot – The basics
      • A simple SQL Server backup solution
      • A simple SQL Server backup solution – A next step
  • My other dummy projects
  • Games
    • Space Y: An Asteroids clone
  • Services
    • What’s my user agent
    • What’s my IP address
  • Donate
  • About
  • Toggle search form

FuelPHP & PHP installation issues

Posted on September 21, 2021September 21, 2021 By

Some time ago I published some posts about configuring a PHP development environment in a Windows machine. If you are interested, you can find here the first post of the series.

Staying on this topic, these days I needed to create a new PHP project with FuelPHP framework, using the environment configured in the posts mentioned above. I usually install FuelPHP downloading the code from the official website https://www.fuelphp.com, and copying it in my development folder.

When I started the application for the first time, I got some errors that I want to share with you in this post.

In some cases the solution required to modify php.ini configuration file. If you are not sure where it is, you can create a simple PHP test page and call the function phpInfo() to exactly know where the file is located. I also suggest to create a backup copy of php.ini, in such a way that you can easily go back in case of problems.

Note that I’m using PHP version 7.4.9 running on Windows 10 / IIS 10 and FuelPHP 1.8.2.

This is the content of test.php page:

<? phpInfo()

And this is the output of the test.php page, where you can see the full path of php.ini:

Let’s start..

Error – could not find driver in C:\….\fuel\core\classes\ database\pdo\ connection.php on line 86

I’ms using MySql as database server, so the problem here is that the PDO extension for MySql is not enabled.

Open the file php.ini and check the following:

  • Check that the parameter “extension_dir” is uncommented and correctly configured; usually the following should be ok in most cases:
; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
;extension_dir = "./"
; On windows:
extension_dir = "ext"
  • Uncomment the following lines:
extension=mysqli
extension=pdo_mysql

This should be enough to solve the problem.

shutdown – Fuel requires Sodium support in PHP. Either use PHP 7.2+, install the libsodium PECL extension, of the sodium-compat composer package!

This error, as the previous, requires you to modify php.ini configuration. You need to uncomment the following line to enable the Sodium extension:

extension=sodium

Fuel\Core\Fuel::init – The configured locale en_US is not installed on your system.package!

This message means that the locale configured in FuelPHP configuration file doesn’t exists in your system. The mistake I was making was that I spelled it incorrectly. The wording “en_US” is what I used in Ubuntu, but since I am now developing with a Windows machine, the locale must be written differently. In fact in Windows you have tu use “en-US”. Here you can find the list supported by Windows, and the correct way to write them.

So open the file \fuel\app\config\config.php and modify it with the correct locale:

	/**
	 * -------------------------------------------------------------------------
	 *  Localization & internationalization settings
	 * -------------------------------------------------------------------------
	 */

	/**
	 *  The default language.
	 */

	 'language' => 'en',

	/**
	 *  Fallback language when file isn't available for default language.
	 */

	// 'language_fallback' => 'en',

	/**
	 *  PHP set_locale() setting. Use null to not set.
	 */

	'locale'             => 'en_US',

I think I can stop here.

Happy coding!

FuelPHP, PHP

Post navigation

Previous Post: Is Environment.TickCount reliable?
Next Post: TDP Robot version 0.80.0.0

Related Posts

Configure a PHP development environment in Windows (part 3 of 4) PHP
Configure a PHP development environment in Windows (part 1 of 4) PHP
FuelPHP session storage FuelPHP
Fatal error using FuelPHP and Imagick extension FuelPHP
HTML AJAX image upload & preview with JQuery and PHP AJAX
Configure a PHP development environment in Windows (part 4 of 4) MySql

Search

Subscribe to our newsletter

Related posts

  • FuelPHP session storage
  • Fatal error using FuelPHP and Imagick extension
  • Add a new website to an Apache installation
  • Install Imagick extension for PHP on Linux CentOS 7

Categories

  • .NET 6 (1)
  • AJAX (1)
  • Android (2)
  • Apache (4)
  • ASP.NET (9)
  • ASP.NET MVC (3)
  • Avalonia UI (1)
  • BCP (1)
  • Bitlocker (2)
  • C# (14)
  • CentOS (4)
  • ClosedXML (1)
  • CLR (1)
  • DNS (1)
  • Encryption (3)
  • Excel (2)
  • FuelPHP (3)
  • Google Chrome (1)
  • GSuite (1)
  • HTML (1)
  • Imagick (2)
  • Javascript (1)
  • Kindle (1)
  • LAMP (3)
  • Linux (6)
  • MariaDB (2)
  • Mathematics (2)
  • MySql (4)
  • NPOI (1)
  • Office 365 (1)
  • Perl (1)
  • PHP (6)
  • Programming (1)
  • Remote desktop (1)
  • SFTP (2)
  • Sockets (3)
  • Sql Server (18)
  • Sql Server 2016 (14)
  • Sql Server 2019 (1)
  • SSL (2)
  • Task scheduler (1)
  • Telerik ASP.NET AJAX (2)
  • The Dummy Programmer Chat (2)
  • The Dummy Programmer Robot (6)
  • Threading (5)
  • Tools (1)
  • TPL (3)
  • TypeScript (3)
  • Ubuntu (4)
  • Virtualization software (3)
  • Visual Studio (1)
  • Visual Studio Code (2)
  • Web fonts (1)
  • Web programming (6)
  • Windows (12)
  • Windows 10 (15)
  • Windows Forms (1)
  • Windows Server (5)

Copyright © 2022 The Dummy Programmer | Privacy Policy |

Powered by PressBook Masonry Dark