Skip to main content

/usr/bin/env: 'php\r': No such file or directory

Running Docker, I deleted the images and containers they had been built to date.  Time to refresh the environment and see what works and what isn't working.  This action was a result of the dev environment failing to load.

 

Current versions

The PHP version is 8.1.12 apache 2.4.54-bullseye

Composer response

Composer versions 2.4.4 2022-10-27 14:39:29

PHP response

mysql dump FLUSH TABLES access denied

I've recently upgraded the server Ubuntu 20.04 updating the PHP version from 7.4 to 8.1.  However, when I've attempted to export the MySQL database using the command

drush sql-dump --extra-dump=--no-tablespaces --result-file=../sql/db-2023-02-25.sql

I seeing the following response

Drupal toc_js explode() deprecated function

A recent upgrade to PHP 8.1, has highlighted an error that hadn't been appearing previously.

Deprecated function : explode(): Passing null to parameter #2 ($string) of type string is deprecated in toc_js_node_view()(line 130 of modules/contrib/toc_js/toc_js.module).

In the top_js.module file from L124

Drush a few common commands to import and reset

Working through and importing JSON data into a content type.

 

Drush migration commands

Check the status of the migration data

lando drush migrate-status

Reset the migration status 

lando drush migrate-reset-status  migratable_riverdata_json

Import JSON data

Docker - Warning: copy(): SSL operation failed with code 1. OpenSSL Error messages:

Build the PHP base image with apache-buster using the Dockerfile.base

Since JN blocks some libraries update and pull, follow the following steps to build the base image locally.

Run the following command to build the base PHP image:
Make sure you are in the project root directory before running the command and its a fresh window after changing the proxy

CLI using drush to drop tables in your db and reload

This is a relatively quick process, beginning with dropping the database tables

lando drush sql-drop -y

Import a MySQL database

lando db-import {filename}

such as 

lando db-import riverdev.2022-10-03-1664769553.sql.gz

Rebuild cache

lando drush cr

Finally, export your config

Selecting a search methodology

Currently, we are upgrading a site from Drupal 7 to Drupal 9.  During this upgrade, we have the opportunity to the site's search functionality and select a tool that is most suited to the website's requirements.

Subscribe to Drupal