Unable CodeIgniter 4 Foundations Code Samples - Lonnie Ezell Book |
Hi
I am unable to run the CodeIgniter 4 Foundations Code Samples by Lonnie Ezell. https://github.com/lonnieezell/ci4-foundations Here are the errors thrown when I run php spark serve: I tried to use the rest of the assets in the root folder above the project-01, project-2 folders but to no avail. Code: C:\xampp\htdocs\project1328>php spark serve
This has to be your settings with Composer etc; Because I manually install it and it runs just fine.
Sounds like a Composer autoload problem. If you change the folder of the public folder to something else, you need to edit spark and tell it where the folder is. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(03-28-2021, 08:54 PM)InsiteFX Wrote: This has to be your settings with Composer etc; Because I manually install it and it runs just fine.Hi InsiteFX: 1. I downloaded the zip file. Unzipped the contents under c:\xampp\htdocs. 2. I cd to C:\xampp\htdocs\ci4-foundations-master\project-01 3. I typed php spark serve I am still getting the same errors. I have tried the other projects also. I am not messing with Composer for this project. Simply download, unzip, cd to project folder and run php spark serve. Please let me know how you got yours to work. Best regards AHirsi
I also use xampp but I use vhosts, I just created a new project called ci4foundations and set the root path to
that. I setup my localhost in windows hosts like found.local but you can use localhost. I only use spark for configuring things etc; What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
You will need to use Composer to install the CodeIgniter 4 framework for the example projects; the repository doesn't include it.
In my case I tried to upgrade my CI setup, and all files I didn't adapt I thought I could easily copy them to retrieve the latest file. Like:
Code: cp vendor/codeigniter4/framework/app/Config/Constants.php ./app/Config/ However, I did the same for the app/Config/Paths.php file, but that resulted in your error message as well. Bottom-line: don't try to replace the Paths.php file from upstream. And the $systemDirectory variable in Paths.php should look like this: PHP Code: public $systemDirectory = __DIR__ . '/../../vendor/codeigniter4/framework/system';
It seem the sample code needs PHP 7.3.
Code: $ git clone [email protected]:lonnieezell/ci4-foundations.git Worked with PHP 7.3.33.
@kenjis has it right. I believe the biggest missing step, though, was that it required composer-based install to get the dependencies, like the framework itself, loaded.
|
Welcome Guest, Not a member yet? Register Sign In |