Upgrade Drupal Website from version 8.7 to 9.3 - php

I'm having an issue upgrading my Drupal website from Drupal version 8.7 site to 9.3
Tried to run the automatic update script from Drupal on the staging environment, but even though the script displayed a success message, somehow the website return an unexpected error and is totally inaccessible.
I have a freshly installed Mac Book Pro with only a local web server (MAMP) installed and a locally cloned git of website code without a composer build, so any help with detail on a step-by-step workaround is greatly appreciated.
Thanks in advance for your support.
I already check the application.log and it produces this error below.
But I can't find any of these files on my site build, can someone help me out with what do I need to do to fix this issue?
==> app.log <== Error: Class 'Drush\Log\DrushLog' not found in /app/core/lib/Drupal/Component/DependencyInjection/Container.php on line 262 #0 /app/core/lib/Drupal/Component/DependencyInjection/Container.php(176): Drupal\Component\DependencyInjection\Container->createService(Array, 'logger.drupalto...') #1 /app/core/lib/Drupal/Component/DependencyInjection/Container.php(437): Drupal\Component\DependencyInjection\Container->get('logger.drupalto...', 1) #2 /app/core/lib/Drupal/Component/DependencyInjection/Container.php(276): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) #3 /app/core/lib/Drupal/Component/DependencyInjection/Container.php(176): Drupal\Component\DependencyInjection\Container->createService(Array, 'logger.factory') #4 /app/core/lib/Drupal/Component/DependencyInjection/Container.php(437): Drupal\Component\DependencyInjection\Container->get('logger.factory', 1) #5 /app/core/lib/Drupal/Component/DependencyInjection/Container.php(240): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) #6 /app/core/lib/Drupal/Component/DependencyInjection/Container.php(176): Drupal\Component\DependencyInjection\Container->createService(Array, 'autologout.mana...') #7 /app/core/lib/Drupal/Component/DependencyInjection/Container.php(437): Drupal\Component\DependencyInjection\Container->get('autologout.mana...', 1) #8 /app/core/lib/Drupal/Component/DependencyInjection/Container.php(240): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) #9 /app/core/lib/Drupal/Component/DependencyInjection/Container.php(176): Drupal\Component\DependencyInjection\Container->createService(Array, 'autologout_even...') #10 /app/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(136): Drupal\Component\DependencyInjection\Container->get('autologout_even...')

I would suggest first, checking the Drupal status report and making sure that there are no alerts and warnings still present on the information.
If there are no critical issues reported on the status, backup existing source code and database for safekeeping.
These particular error messages are related to missing Drupal components and dependencies, so the best approach is to run the composer.
If you're on a new device, download the composer first.
Open the Mac Terminal and run this command to download and set up the composer on your devices.
sudo php -r "copy('https://getcomposer.org/installer','composer-setup.php');"
sudo php composer-setup.php
sudo php -r "unlink('composer-setup.php');"
To install globally and make composer executable on any folder, run
sudo mv composer.phar /usr/local/bin/composer
change the directory to the local website code and run
composer install
wait until it finished installing the required dependencies and run
composer update
just to make sure, the dependencies are updated as well.
your error mentioned missing drush so run composer with drush, and add all the installed files that was just been added to the local git source code
composer require drush/drush
git add composer.lock -f
then just add all the new files, commit and push all the changes to the staging website
git add .
git commit -m "message about dependencies"
git push
If your cloud provider has CI/CD integrated into the repository, the code push should have deployed everything directly on the site.

Related

Docker compose php version lower than actual

I'm trying to do docker-compose up -d --build and there´s a part where I get the errors
RUN composer install --prefer-dist --no-dev --optimize-autoloader --no-interaction:
#0 0.785 Installing dependencies from lock file
#0 0.787 Verifying lock file contents can be installed on current platform.
#0 0.802 Your lock file does not contain a compatible set of packages. Please run composer update.
#0 0.802
#0 0.802 Problem 1
#0 0.802 - doctrine/lexer is locked to version 3.0.0 and an update of this package was not requested.
#0 0.802 - doctrine/lexer 3.0.0 requires php ^8.1 -> your php version (8.0.6) does not satisfy that requirement.
but when I do php --version I have version 8.2.0 and when I run Apache I get the same result, version 8.2.0.
I've tried basically everything I've found online but nothing seems to fix the issue.
Am I doing something wrong?
Thanks alot for your time :)
The problem is not in the docker itself, during the initialization of the instance it tries to run a composer install and finds a discrepancy between the content of the composer.lock and its instance.
In its place, initially I would try to delete this composer.lock file, if that doesn't solve it, the ideal would be to check the Dockerfile and check the PHP version and the scripts it runs, maybe even add a flag --ignore-platform- reqs on composer install

Having trouble adding the Wikibase extension to a MediaWiki Install

I am trying to set up a new MediaWiki 1.35 install and add the Wikibase extension. The install is running on a Debian 10 LXC container hosted on proxmox.
I have been following the Wikibase/Installation MediaWiki guide but I seem to be stuck. When I get to the 'Run Maintenance Scripts' step and try to run php update.php it thows the following error:
[10e7e1e19b828fdfd6418545] [no req] Error from line 47 of /var/lib/mediawiki/extensions/Wikibase/lib/WikibaseLib.entitytypes.php: Class 'Wikibase\DataModel\Entity\ItemId' not found
Backtrace:
#0 /var/lib/mediawiki/extensions/Wikibase/client/includes/WikibaseClient.php(532): require()
#1 /var/lib/mediawiki/extensions/Wikibase/client/includes/WikibaseClient.php(748): Wikibase\Client\WikibaseClient::getDefaultEntityTypes()
#2 /var/lib/mediawiki/extensions/Wikibase/client/includes/WikibaseClient.php(796): Wikibase\Client\WikibaseClient::newInstance()
#3 /var/lib/mediawiki/extensions/Wikibase/client/includes/Usage/Sql/SqlUsageTrackerSchemaUpdater.php(64): Wikibase\Client\WikibaseClient::getDefaultInstance()
#4 /var/lib/mediawiki/includes/installer/DatabaseUpdater.php(554): Wikibase\Client\Usage\Sql\SqlUsageTrackerSchemaUpdater::fillUsageTable(MysqlUpdater)
#5 /var/lib/mediawiki/includes/installer/DatabaseUpdater.php(522): DatabaseUpdater->runUpdates(array, boolean)
#6 /var/lib/mediawiki/maintenance/update.php(181): DatabaseUpdater->doUpdates(array)
#7 /var/lib/mediawiki/maintenance/doMaintenance.php(107): UpdateMediaWiki->execute()
#8 /var/lib/mediawiki/maintenance/update.php(253): require_once(string)
#9 {main}
I made sure to clone the proper version of Wikibase (REL1_35). I've looked everywhere for a solution but it seems like I have messed up in a unique way. I should also mention that is my first time setting up a MediaWiki server so any help is greatly appreciated.
I made a git and uploaded everything in the root of the MediaWiki install: https://github.com/ggosset2017/MediaWiki-Install.git
Update:
Looks like it's a problem with some dependency. I did make sure to install composer and install dependencies following the WIkibase guide linked above. I used the following commands/file edits.
First, I updated the composer.local.json file in the root of MediaWiki install to match the following:
{
"extra": {
"merge-plugin": {
"include": [
"extensions/Wikibase/composer.json"
]
}
},
"require": {
"monolog/monolog": "~2.0.2"
}
}
sshed into the container and ran the following.
rm composer.lock
composer install --no-dev
Everything seemed to download fine and the only error I got was the following:
Warning from https://repo.package.org: you are using an outdated version of Composer. Composer 2 is now available and you should upgrade. See https://getcomposer.org/2
I expected this error as MediaWiki does not support composer 2, at least according to this: https://www.mediawiki.org/wiki/Composer#Installing_Composer
Update 2:
Looks like my composer.local.jason file was somehow changed to composer.local.jason-sample. I have removed the -sample appended to that file name. Now composer is throwing the following error when I try to run rm composer.lock and composer install --no-dev
image of composer error
In Solver.php line 243:
Problem 1
- The requested package monolog/monolog ~2.0.2 exists as monolog/monolog[1.25.5] but these are rejected by your constraint.

Unable to download & install Laravel 5 with composer. Error: HTTP request failed

I'm not able to download lavarvel installer using composer 1.2.0 (latest version)
The error received: Failed to open stream: HTTP request failed!
I googled and could not find the answer to fix this to problem.
If possible, someone please try to run this command composer global require "laravel/installer" to check if it works? I think the link to packaglist is no longer valid but I'm not sure.
C:\wamp\www\st>composer self-update -vvv
Reading ./composer.json
Loading config file ./composer.json
Checked CA file C:\Users\Louis\AppData\Local\Temp\composer-cacert-bcf331364fef73d53e4368ba519a6c3fcb21ea7836c3d8efad4ec32731e8152a.pem: valid
Executing command (C:\wamp\www\st): git branch --no-color --no-abbrev -v
Executing command (C:\wamp\www\st): git describe --exact-match --tags
Executing command (C:\wamp\www\st): git log --pretty="%H" -n1 HEAD
Reading C:/Users/Louis/AppData/Roaming/Composer/composer.json
Loading config file C:/Users/Louis/AppData/Roaming/Composer/composer.json
Running 1.2.0 (2016-07-19 01:28:52) with PHP 5.5.12 on Windows NT / 6.2
You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
Downloading https://getcomposer.org/versions
You are already using composer version 1.2.0 (stable channel).
Two ways of laravel install(normally i follow step 1)
step 1.
download zip file from github https://github.com/laravel/laravel
and unzip and put it on wamp/www(where you normally put your project)
wamp>www>folderproject>shift+right click>open command window
here> write on composer composer install
step 2.
go to wamp>www>hold shift and click right mouse ->open command window here->paste composer create-project laravel/laravel in command prompt
then go to laravel project then shift+ right click ,open command window here>write php artisan serve
Config Laravel
• after install laravel then goes to wamp>www>laravelproject
• copy from here .env.example ,and paste it here then .env - Copy.example will create,
• then open sublime ,go to .env - Copy.example file right click and rename to .env and enter
• then goes to wamp>www>laravelproject ,shift+right click ,write php artisan key:generate in command promt
I figured it out this morning. The problem was Kaspersky Internet Security blocked the connection between my PC and packagist.org . I am surprised that it never happened to anyone but me.
*** Solution:
- Disable your antivirus for a momment and run the command installing Laravel.
Thank you all.
Hey i guess you using php 5.5 first upgrade your php version then install use
composer global require "laravel/installer"
if you don't want upgrade your php then
use
composer global require "laravel/installer=~1.1"
I believe your problem is that the config.json-file for Composer has ""packagist": false" inside the file. Try opening the file and changing to : true"
Or run,
cd ~/.composer/vendor/bin
Then
composer global require "laravel/installer"
you can easily first disable your antivirus , then check your version of php that you are using make sure that it is above PHP VERSION 5.5 then open your terminal or cmd then go to directory of composer then paste `composer global require "laravel/installer"

My Laravel installation error on localhost

I am new to Laravel, I have installed the Laravel on my localhost using
WAMP server but I am getting an error after all steps.
The errors are:
( ! ) Warning: require(C:\wamp\www\laravel/../bootstrap/autoload.php): failed to open stream: No such file or directory in C:\wamp\www\laravel\index.php on line 21
( ! ) Fatal error: require(): Failed opening required 'C:\wamp\www\laravel/../bootstrap/autoload.php' (include_path='.;C:\php\pear') in C:\wamp\www\laravel\index.php on line 21
I have used below link for Laravel installation
http://www.wikihow.com/Install-Laravel-Framework-in-Windows
I have tried to debug the issue but haven't found success in the installation.
Please let me know what is missing in installation.
You need to install Composer, open up the command prompt and cd to your directory (or hold Shift while right-clicking on your directory and clicking Open command window here) and there run composer install.
You can simplify the Laravel installation with Composers create-project command.
composer create-project laravel/laravel path
Laravel dependencies are not installed yet. That is why it is giving you this error.
https://getcomposer.org/download/
Go to this link and download composer if you haven't already.
Move the composer file to /usr/bin and rename it to just composer.
Go into the root directory of your laravel application. And run:
composer update
This will install and update all required dependencies.
In case you are on windows, which is less likely, but if you are, just download and install composer via the installer and issue the same command in you project's root directory.
Composer is PHP's dependency manager.
In the root directory of your laravel installation you will find a composer.json file. It contains the list of all your project's dependencies. If you ever need to install a package in your project, it becomes very easy. You just have to edit the composer.json file and let it know which package you need. Issuing composer update will install new package listings and update all existing ones.
just to be clear I'm not big fan of wamp.
I've just took quick look at the
http://www.wikihow.com/Install-Laravel-Framework-in-Windows
and I suppose laravel framework is not going to work best with point 11 to 14 modifications.
Baseline for laravel to work is you need to http serve /public folder in a properly configured environment (after composer install and create-project as described earlier).
If you want to take full advantage of laravel you need to often cli `php or composer (at least)` efficiently.
While using laravel I suggest installing PHP and MYSQL yourself from scratch (it really takes few minutes) and using convenient IDE (like PHPSTORM for example).
Nowadays PHP has builtin http server, so you don't need any http server in your dev environment.
So in Windows:
Install PHP and enable required libraries in php.ini
Install and configure local mysql server (easiest way installing via MySQL installer)
Start development server by invoking php.exe -S localhost:80 -t "absolute-path-to-your-laravel-installation\public" like for example C:\htdocs\laravel\public via commandLine
Enter url in your favorite browser http://localhost
Hope that will help to get you started.

What can I do to fix this error when attempting to install active record for composer from github?

I create a JSON file called composer.json with
{
"require":{"php-activerecord/php-activerecord": "dev-master"}
}
I then go to the folder in Terminal and type: composer install
I receive this fail message:
[RuntimeException]
Failed to clone https://github.com/kla/php-activerecord.git, git was not found, check that it is installed a
nd in your PATH env.
sh: git: command not found
I have no idea what to do. Any help would be great.
Your system does not find the command line command git.
Your options:
Install git for the command line.
Don't install "dev-master" of that library, but a tagged version instead.
The first one will make it work in general. The second one will avoid using git to download the source code, but a ZIP file of that version.

Categories