Skip to content

The Dummy Programmer

Stories of daily programming

  • Home
  • My other dummy projects
  • Games
    • Space Y: An Asteroids clone
  • Services
    • What’s my user agent
    • What’s my IP address
  • 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: Start using Visual Studio Code and Typescript

Related Posts

Configure a PHP development environment in Windows (part 2 of 4) PHP
FuelPHP session storage FuelPHP
Configure a PHP development environment in Windows (part 3 of 4) PHP
Fatal error using FuelPHP and Imagick extension FuelPHP
Configure a PHP development environment in Windows (part 1 of 4) PHP
Configure a PHP development environment in Windows (part 4 of 4) MySql

Search

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)
  • .NET 7 (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)
  • Games (2)
  • Google Chrome (1)
  • GSuite (1)
  • HTML (1)
  • Imagick (2)
  • Javascript (1)
  • Kindle (1)
  • LAMP (3)
  • Linux (7)
  • 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 (20)
  • Sql Server 2016 (14)
  • Sql Server 2019 (1)
  • SSL (4)
  • Task scheduler (1)
  • Telerik ASP.NET AJAX (2)
  • The Dummy Programmer Chat (2)
  • Threading (5)
  • Tools (1)
  • TPL (3)
  • TypeScript (3)
  • Ubuntu (4)
  • Virtualization software (3)
  • Visual Studio (1)
  • Visual Studio Code (2)
  • VueJS (1)
  • Web fonts (1)
  • Web programming (6)
  • Windows (12)
  • Windows 10 (15)
  • Windows Forms (1)
  • Windows Server (6)

Copyright © 2024 The Dummy Programmer | Privacy Policy | Terms of use |

Powered by PressBook Masonry Dark

Manage Cookie Consent
This site doesn’t collect user personal data and doesn’t install profiling or analytical cookies, either its own or from third parties. Read our privacy policy for more info.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
View preferences
{title} {title} {title}