Cloning a Craft CMS project to XAMPP - php

I am fairly new to git and I am looking to clone a repo to XAMPP.
From what I understand I should be able to just clone it to HTDOCS and it should work if all the dependencies are installed.
I get this error message when I visit the project folder in my browser.
Fatal error: Uncaught Error: Call to a member function init() on null
in C:\xampp\htdocs\sandbox\craft\app\services\CacheService.php:114
Stack trace: #0
C:\xampp\htdocs\sandbox\craft\app\framework\base\CModule.php(394):
Craft\CacheService->init() #1
C:\xampp\htdocs\sandbox\craft\app\etc\web\WebApp.php(595):
CModule->getComponent('cache', true) #2
C:\xampp\htdocs\sandbox\craft\app\framework\base\CModule.php(103):
Craft\WebApp->getComponent('cache') #3
C:\xampp\htdocs\sandbox\craft\app\services\ConfigService.php(392):
CModule->__get('cache') #4
C:\xampp\htdocs\sandbox\craft\app\services\HttpRequestService.php(1181):
Craft\ConfigService->usePathInfo() #5
C:\xampp\htdocs\sandbox\craft\app\services\HttpRequestService.php(131):
Craft\HttpRequestService->getNormalizedPath() #6
C:\xampp\htdocs\sandbox\craft\app\framework\base\CModule.php(394):
Craft\HttpRequestService->init() #7
C:\xampp\htdocs\sandbox\craft\app\etc\web\WebApp.php(595):
CModule->getComponent('request', true) #8
C:\xampp\htdocs\sandbox\craft\app\framework\base\CMo in
C:\xampp\htdocs\sandbox\craft\app\services\CacheService.php on line
114
I know this a vague question but I'd appreciate any help.
Thank you

I think once you will clone the craft project from your git repo. You need to add .Env file into it. Then your need "uploads" folder. Also you should run the composer install command to install all the dependencies.
After all this process if you still getting the same error then you should try to remove cache from your runtime cache folder and also you can remove compiled classes and templates once.
I hope this will work.

Related

After updating php version in XAMPP I'm facing Fatal Error in http://localhost/phpmyadmin/

For the New Laravel project, I need to update the PHP version using XAMPP,
After the update, the PHP version and apache folder when I start apache and MySQL from the XAMPP control panel this working but I open localhost/phpmyadmin/ it shows me fatal error and doesn't show the database.
Fatal error: Uncaught mysqli_sql_exception: You are not using binary logging in C:\xampp\phpMyAdmin\libraries\classes\Dbi\DbiMysqli.php:199 Stack trace: #0 C:\xampp\phpMyAdmin\libraries\classes\Dbi\DbiMysqli.php(199): mysqli->query('SHOW MASTER LOG...', 0) #1 C:\xampp\phpMyAdmin\libraries\classes\DatabaseInterface.php(316): PhpMyAdmin\Dbi\DbiMysqli->realQuery('SHOW MASTER LOG...', Object(mysqli), 1) #2 C:\xampp\phpMyAdmin\libraries\classes\DatabaseInterface.php(1869): PhpMyAdmin\DatabaseInterface->tryQuery('SHOW MASTER LOG...', 256, 1, false) #3 C:\xampp\phpMyAdmin\libraries\classes\Menu.php(573): PhpMyAdmin\DatabaseInterface->fetchResult('SHOW MASTER LOG...', 'Log_name', NULL, 256, 1) #4 C:\xampp\phpMyAdmin\libraries\classes\Menu.php(107): PhpMyAdmin\Menu->_getServerTabs() #5 C:\xampp\phpMyAdmin\libraries\classes\Menu.php(70): PhpMyAdmin\Menu->_getMenu() #6 C:\xampp\phpMyAdmin\libraries\classes\Header.php(445): PhpMyAdmin\Menu->getDisplay() #7 C:\xampp\phpMyAdmin\libraries\classes\Response.php(323): PhpMyAdmin\Header->getDisplay() #8 C:\xampp\phpMyAdmin\libraries\classes\Response.php(336): PhpMyAdmin\Response->_getDisplay() #9 C:\xampp\phpMyAdmin\libraries\classes\Response.php(495): PhpMyAdmin\Response->_htmlResponse() #10 [internal function]: PhpMyAdmin\Response->response() #11 {main} thrown in C:\xampp\phpMyAdmin\libraries\classes\Dbi\DbiMysqli.php on line 199
I feel the main issue is that your tried to upgrade only php instead of the whole Xampp Bundle. Either you should install complete xampp again or you should upgrade phpMyAdmin manually too as this will fix the php compatibility issues.
I had this exact same issue and I have spent many hours trying to figure this out, so it is as simple as this.
Once you have upgraded your php. (In my case I upgraded to php 8.1.10)
Make a copy of your phpMyAdmin folder renaming it different than the current value that it has.
Download phpMyAdmin 5.2.0 or higher.
Unzip the file, and then copy it into your xampp folder replacing the old phpMyAdmin folder.
Inside the new folder create the file config.inc.php and paste inside there the data that is in config.inc.php located in your old phpMyAdmin folder.
Thats it!

Laravel Cannot declare class Symfony\Component\HttpFoundation\AcceptHeader, because the name is already in use

I just took a project from a couple of months ago which was made in Laravel. This project also utilizes Laravel Voyager - the admin panel package.
After browsing to http://example.com/admin, I got this weird error which came out of nowhere and I'm also unsure how to debug it. It looks like this:
Fatal error: Cannot declare class Symfony\Component\HttpFoundation\AcceptHeader, because the name is already in use in /c/Users/User/Code/example-website/vendor/symfony/http-foundation/AcceptHeader.php on line 22
Fatal error: Uncaught Error: Class 'Symfony\Component\HttpFoundation\AcceptHeaderItem' not found in /c/Users/User/Code/example-website/vendor/symfony/http-foundation/AcceptHeader.php:61 Stack trace: #0 [internal function]: Symfony\Component\HttpFoundation\AcceptHeader::Symfony\Component\HttpFoundation\{closure}(Array) #1 /c/Users/User/Code/example-website/vendor/symfony/http-foundation/AcceptHeader.php(57): array_map(Object(Closure), Array) #2 /c/Users/User/Code/example-website/vendor/symfony/http-foundation/Request.php(1664): Symfony\Component\HttpFoundation\AcceptHeader::fromString('text/html,appli...') #3 /c/Users/User/Code/example-website/vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithContentTypes.php(54): Symfony\Component\HttpFoundation\Request->getAcceptableContentTypes() #4 /c/Users/User/Code/example-website/vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithContentTypes.php(44): Illuminate\Http\Request->wantsJson() #5 /c/Users/User/Code/example-website/vendor/laravel/framework/src/Illumina in /c/Users/User/Code/example-website/vendor/symfony/http-foundation/AcceptHeader.php on line 61
This error is very expected and I've never seen it before in my project (or anywhere else for that matter).
How can I debug this issue?
As a sanity check, delete the vendor directory and then run composer install to re-fetch your dependencies and see if the error is resolved. If not, then attempt composer update to fetch the latest versions of your dependencies in which this issue may have been resolved.

Setup a Laravel existing project

I'm trying to install an existing Laravel project by running a "composer install" command but i'm getting the following errors :
PHP Fatal error: Uncaught Error: Class 'Symfony\Thanks\Command\ThanksCommand' not found in /home/lyes/Documents/AppStage/vendor/symfony/thanks/src/Thanks.php:58
Stack trace:
#0 /usr/share/php/Composer/Plugin/PluginManager.php(236): Symfony\Thanks\Thanks->activate(Object(Composer\Composer), Object(Composer\IO\ConsoleIO))
#1 /usr/share/php/Composer/Plugin/PluginManager.php(205): Composer\Plugin\PluginManager->addPlugin(Object(Symfony\Thanks\Thanks))
#2 /usr/share/php/Composer/Plugin/PluginManager.php(261): Composer\Plugin\PluginManager->registerPackage(Object(Composer\Package\CompletePackage))
#3 /usr/share/php/Composer/Plugin/PluginManager.php(76): Composer\Plugin\PluginManager->loadRepository(Object(Composer\Repository\InstalledFilesystemRepository))
#4 /usr/share/php/Composer/Factory.php(384): Composer\Plugin\PluginManager->loadInstalledPlugins()
#5 /usr/share/php/Composer/Factory.php(576): Composer\Factory->createComposer(Object(Composer\IO\ConsoleIO), Array, false)
#6 /usr/share/php/Composer/Console/Application.php(332): C in /home/lyes/Documents/AppStage/vendor/symfony/thanks/src/Thanks.php on line 58
Fatal error: Uncaught Error: Class 'Symfony\Thanks\Command\ThanksCommand' not found in /home/lyes/Documents/AppStage/vendor/symfony/thanks/src/Thanks.php:58
Stack trace:
#0 /usr/share/php/Composer/Plugin/PluginManager.php(236): Symfony\Thanks\Thanks->activate(Object(Composer\Composer), Object(Composer\IO\ConsoleIO))
#1 /usr/share/php/Composer/Plugin/PluginManager.php(205): Composer\Plugin\PluginManager->addPlugin(Object(Symfony\Thanks\Thanks))
#2 /usr/share/php/Composer/Plugin/PluginManager.php(261): Composer\Plugin\PluginManager->registerPackage(Object(Composer\Package\CompletePackage))
#3 /usr/share/php/Composer/Plugin/PluginManager.php(76): Composer\Plugin\PluginManager->loadRepository(Object(Composer\Repository\InstalledFilesystemRepository))
#4 /usr/share/php/Composer/Factory.php(384): Composer\Plugin\PluginManager->loadInstalledPlugins()
#5 /usr/share/php/Composer/Factory.php(576): Composer\Factory->createComposer(Object(Composer\IO\ConsoleIO), Array, false)
#6 /usr/share/php/Composer/Console/Application.php(332): C in /home/lyes/Documents/AppStage/vendor/symfony/thanks/src/Thanks.php on line 58
Can anyone help me, I am really overwhelmed
Just delete vendor folder and than run composer update command
Try using composer update and composer dump-autoload command
When you run composer install it will look for a lock file and install whatever is contained in it. Check if your composer.lock or run composer update command
Try the following steps:
Remove the vendor folder if already there
Delete the composer.lock file
Run composer install command in the terminal.

CakePHP: Could not load configuration file

I'm trying to get a cakephp project up and running from a svn checkout on my mountain lion computer.
I changed all the cache write permissions find but now I have one last fatal error that's not letting the app run.
Fatal error: Uncaught exception 'ConfigureException' with message 'Could not load configuration file: /Users/mike/cake2cribs/cake2cribs/app/Config/core-production.php' in /Users/mike/cake2cribs/cake2cribs/lib/Cake/Configure/PhpReader.php:77
Stack trace: #0
/Users/mike/cake2cribs/cake2cribs/lib/Cake/Core/Configure.php(267):
PhpReader->read('core-production') #1
/Users/mike/cake2cribs/cake2cribs/app/Config/core.php(287):
Configure::load('core-production') #2
/Users/mike/cake2cribs/cake2cribs/lib/Cake/Core/Configure.php(76):
include('/Users/mike/cak...') #3
/Users/mike/cake2cribs/cake2cribs/lib/Cake/bootstrap.php(146):
Configure::bootstrap(true) #4
/Users/mike/cake2cribs/cake2cribs/app/webroot/index.php(81):
include('/Users/mike/cak...') #5 {main} thrown in
/Users/mike/cake2cribs/cake2cribs/lib/Cake/Configure/PhpReader.php on
line 77
it fails on this line inside index.php inside webroot
if (!include ('Cake' . DS . 'bootstrap.php')) {
$failed = true;
}
Any ideas as to what could be the cause?
I've never done an Ubuntu install, I've always just downloaded the source and put it in my webroot. Anyway, cake always expects to have a file called core.php which holds all the config info. Maybe the Ubuntu install just expects core-production.php, so you might just need to copy the core.php file in app/Config and rename it to core-production.php.

cakephp upgrade shell debug kit error

I' m trying to use cakephp upgrade shell to migrate my project to cakephp 1.3 -> 2.0.1 but when i run the script, it; s returning the following error:
Error: Plugin DebugKit could not be found.
#0 /Applications/MAMP/htdocs/youppie/lib/Cake/Core/App.php(328): CakePlugin::path('DebugKit')
#1 /Applications/MAMP/htdocs/youppie/lib/Cake/Console/Command/UpgradeShell.php(223): App::pluginPath('DebugKit')
#2 /Applications/MAMP/htdocs/youppie/lib/Cake/Console/Command/UpgradeShell.php(91): UpgradeShell->helpers()
#3 /Applications/MAMP/htdocs/youppie/lib/Cake/Console/Shell.php(372): UpgradeShell->all()
#4 /Applications/MAMP/htdocs/youppie/lib/Cake/Console/ShellDispatcher.php(177): Shell->runCommand('all', Array)
#5 /Applications/MAMP/htdocs/youppie/lib/Cake/Console/ShellDispatcher.php(69): ShellDispatcher->dispatch()
#6 /Applications/MAMP/htdocs/youppie/app/Console/cake.php(41): ShellDispatcher::run(Array)
#7 {main}
I' m running ./Console/cake upgrade upgrade all --dry-run inside app directory
Anyone knows what i'm doing wrong ?
As a rule of thumb, move your plugins folder out of the app, so it is not affected during the upgrade. You could also leave the folder there, but just move the contents of it out of the scene.
Also remember that in 2.0, plugins need to be loaded manually. In your bootstrap file add CakePlugin::loadAll() or just CakePlugin::load('MyPlugin')

Categories