When running drush cim/cr commands in a Drupal 8 (core 8.5.5) project i get the following error:
Fatal error: Default value for parameters with a class type hint can only be NULL in E:\Work\EmakinaCH\IheidCH\web\modules\contrib\search_api_solr\src\Plugin\search_api\backend\SearchApiSolrBackend.php on line 2669
[error] Drush command terminated abnormally due to an unrecoverable error.
Error: Default value for parameters with a class type hint can only be NULL in E:\Work\EmakinaCH\IheidCH\web\modules\contrib\search_api_solr\src\Plugin\search_api\backend\SearchApiSolrBackend.php, line 2669
And here's the aforementioned line of code
protected function flattenKeys($keys, array $fields = [], string $parse_mode_id = 'phrase') {
This error only occurs on one test machine which is running Win10 + Wamp 64-bit version 3.1.0, regardless of which php version is run on it 5.6, 7.0 or 7.1.9. On any other linux machine i use there are no issues.
Anyone know how to fix this, or what is the cause of this error?
Thanks
Related
I have recently installed laravel through softaculous in CPanel. After the installation, when I tried to open the website, it shows 500 Internal Server Error. Actually, I am a beginner in Laravel. The following errors I got from error_log.
[08-Aug-2020 12:56:03 UTC] PHP Fatal error: Declaration of Carbon\Translator::setLocale($locale) must be compatible with Symfony\Contracts\Translation\LocaleAwareInterface::setLocale(string $locale) in /home/hugar/public_html/jityo.com/vendor/nesbot/carbon/src/Carbon/Translator.php on line 18
[08-Aug-2020 12:56:03 UTC] PHP Fatal error: Uncaught ErrorException: Declaration of Illuminate\Http\Response::setContent($content) should be compatible with Symfony\Component\HttpFoundation\Response::setContent(?string $content) in /home/hugar/public_html/jityo.com/vendor/laravel/framework/src/Illuminate/Http/Response.php:14
Every assistance will be appreciated!.
Check the server php version and the php version in composer.json file of laravel framework, if it's not a match then you have to change the server php version and it will work like a charm. this happened with me as well.
The php version(7.1) on the server was lesser than php version in composer.json(7.2).
The problem fixed by upgrading the php version(7.4) on the server.
I have database with lots of tables in it, when I try to navigate the tables list I ma getting a 500 error from phpmyadmin
this is the related error in the apache log
[proxy_fcgi:error] [pid 14770] [client 94.130.127.152:20932] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught TypeError: Argument 2 passed to PhpMyAdmin\\DatabaseInterface::dataSeek() must be of the type int, string given, called in /var/www/html/phpMyAdmin-5.0.1-all-languages/libraries/classes/Navigation/Nodes/NodeDatabase.php on line 488
and defined in /var/www/html/phpMyAdmin-5.0.1-all-languages/libraries/classes/DatabaseInterface.php:2730
Stack trace:
#0 /var/www/html/phpMyAdmin-5.0.1-all-languages/libraries/classes/Navigation/Nodes/NodeDatabase.php(488): PhpMyAdmin\\DatabaseInterface->dataSeek()
#1 /var/www/html/phpMyAdmin-5.0.1-all-languages/libraries/classes/Navigation/Nodes/NodeDatabase.php(514): PhpMyAdmin\\Navigation\\Nodes\\NodeDatabase->getTablesOrViews()
#2 /var/www/html/phpMyAdmin-5.0.1-all-languages/libraries/classes/Navigation/Nodes/NodeDatabase.php(373): PhpMyAdmin\\Navigation\\Nodes\\NodeDatabase->getTables()
#3 /var/www/html/phpMyAdmin-5.0.1-all-languages/libraries/classes/Navigation/NavigationTree.php(400): PhpMyAdmin\\Navigation\\Nodes\\NodeDatabase->getDa...'
centos7
php7.4
directadmin 1.6
mysql 5.7
php1_release 5.6
php1_mode mod_php
php2_release 7.4
php2_mode php-fpm
my php1_release is php5.6 but since phpmyadmin required php7.2+ I manually changed the handler to point to the php 7.4 fpm socket
I am guesting that some resources are low on the php size which causing this error because its working just fine in my other server ...
so what config do I need to change?
Tanks to #MagnusEriksson here is the solution :
https://github.com/phpmyadmin/phpmyadmin/issues/15772
https://github.com/phpmyadmin/phpmyadmin/commit/6981910c8c2c2fd1aaa515c2a37459e68a3740e3
in libraries/classes/Navigation/NavigationTree.php:129
$this->pos2Value[0] = (int) $_REQUEST['pos2_value'];
just add the cast to int
I have this simple code:
<?php
$client = new \GearmanClient();
$client->addServer();
This gives following error:
PHP Fatal error: Uncaught GearmanException: Failed to set exception option in /var/www/demo-admin/public-html/admin-generico/vendor/generico/components/tests/utils/test-gearman.php:4
Stack trace:
#0 /var/www/demo-admin/public-html/admin-generico/vendor/generico/components/tests/utils/test-gearman.php(4): GearmanClient->addServer()
#1 {main}
thrown in /var/www/demo-admin/public-html/admin-generico/vendor/generico/components/tests/utils/test-gearman.php on line 4
Gearman server is definitely running as confirmed by ps:
ps -A | grep gearman
25698 ? 00:00:00 gearmand
I installed php-gearman from ppa:ondrej/pkg-gearman
Gearman version is 1.1.17
The addServer() method requires a host parameter, even if the gearman server is running locally:
$client->addServer('127.0.0.1');
Even though the documentation says the default is the local server, I've found that it sometimes has to be specified to make that error go away.
The comment by #Kris Peeling gave an idea. I uninstalled everything gearman and installed again. Voila! Problem gone. I didn't have to use the localhost IP.
I referred this: https://www.patreon.com/posts/gearman-now-in-14627464
Can anybody help me to find out solution.
Problem: php artisan command not working on server(using putty name.com) but showing result on my local environment (command prompt windows).
Description: when i am running php artisan command using putty it throws error in my error logs.
PHP Catchable fatal error: Argument 2 passed to Illuminate\Routing\UrlGenerator::__construct() must be an instance of Illuminate\Http\Request, null given, called in /home/hisunil4/intraview.co.in/vendor/laravel/framework/src/Illuminate/Routing/RoutingServiceProvider.php on line 62 and defined in /home/hisunil4/intraview.co.in/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php on line 103
I need to execute a php file on apache tomcat server that needs to access postgresql database. The server is Centos Linux. I have apache tomcat 7 , php , postgresql and php-potgresql installed.
$ cat /etc/php.d/pgsql.ini [gives the following]
; Enable pgsql extension module
extension=pgsql.so
However on loading the required page on a browser, i get the fowllowing error:
HTTP Status 500 - java.lang.RuntimeException: PHP Fatal error: Call to undefined function pg_connect() in /home/criminfo/apache-tomcat-7.0.41/webapps/JavaBridgeTemplate621/hybrid.php on line 4
type Exception report
message java.lang.RuntimeException: PHP Fatal error: Call to undefined function pg_connect() in /home/criminfo/apache-tomcat-7.0.41/webapps/JavaBridgeTemplate621/hybrid.php on line 4
description The server encountered an internal error that prevented it from fulfilling this request.
Any directions on how to fix this will be appreciated.