Laravel frequently showing 'Undefined variable: _SERVER' - php

I am frequently getting the following error in Laravel 5.4.
Notice: Undefined variable: _SERVER in
C:\wamp64\www\hxponline\vendor\symfony\http-foundation\Request.php on
line 305
Notice: Undefined variable: _GET in C:\wamp64\www\hxponline\vendor\symfony\http-foundation\Request.php on
line 315
Fatal error: Uncaught TypeError: Argument 1 passed to Symfony\Component\HttpFoundation\Request::createRequestFromFactory()
must be of the type array, null given, called in
C:\wamp64\www\hxponline\vendor\symfony\http-foundation\Request.php on
line 315 and defined in
C:\wamp64\www\hxponline\vendor\symfony\http-foundation\Request.php:2014
Stack trace: #0
C:\wamp64\www\hxponline\vendor\symfony\http-foundation\Request.php(315):
Symfony\Component\HttpFoundation\Request::createRequestFromFactory(NULL,
Array, Array, Array, Array, NULL) #1
C:\wamp64\www\hxponline\vendor\laravel\framework\src\Illuminate\Http\Request.php(59):
Symfony\Component\HttpFoundation\Request::createFromGlobals() #2
C:\wamp64\www\hxponline\public\index.php(53):
Illuminate\Http\Request::capture() #3 {main} thrown in
C:\wamp64\www\hxponline\vendor\symfony\http-foundation\Request.php on
line 2014
Also in the phpmyadmin page I am getting,
Fatal error: Uncaught Error: Call to a member function setCookie() on
null in C:\wamp64\apps\phpmyadmin4.7.4\libraries\ThemeManager.php:260
Stack trace: #0
C:\wamp64\apps\phpmyadmin4.7.4\libraries\common.inc.php(616):
PMA\libraries\ThemeManager->setThemeCookie() #1
C:\wamp64\apps\phpmyadmin4.7.4\sql.php(18):
require_once('C:\wamp64\apps\...') #2 {main} thrown in
C:\wamp64\apps\phpmyadmin4.7.4\libraries\ThemeManager.php on line 260
I couldn't figure out any reason what is the reason for all these errors.
Any help would be really appreciated.

Related

Encountered an error while trying to use a php framework

Notice: Trying to access array offset on value of type null in
C:\xampp\htdocs\E-LAMAX\app\libraries\Core.php on line 18
Fatal error: Uncaught PDOException: SQLSTATE[42S02]: Base table or
view not found: 1146 Table 'lamax.settings' doesn't exist in
C:\xampp\htdocs\E-LAMAX\app\libraries\Database.php:66 Stack trace: #0
C:\xampp\htdocs\E-LAMAX\app\libraries\Database.php(66):
PDOStatement->execute() #1
C:\xampp\htdocs\E-LAMAX\app\libraries\Database.php(77):
Database->execute() #2
C:\xampp\htdocs\E-LAMAX\app\models\Setting.php(17): Database->single()
#3 C:\xampp\htdocs\E-LAMAX\app\controllers\Pages.php(18): Setting->getSettings() #4
C:\xampp\htdocs\E-LAMAX\app\libraries\Core.php(45): Pages->index() #5
C:\xampp\htdocs\E-LAMAX\public\index.php(4): Core->__construct() #6
{main} thrown in C:\xampp\htdocs\E-LAMAX\app\libraries\Database.php on
line 66
The error is pointing to a database error: Table 'lamax.settings' doesn't exist.
Make sure you have that table in your database

Magento Product Export Issue 1.9.3.6

I am getting PHP Fatal Error while exporting products to CSV
[01-Jan-2020 10:05:44 UTC] PHP Fatal error: Uncaught exception 'Exception' with message 'File '/home/xyz/public_html/abc/media/catalog/category/' does not exists.' in /home/xyz/public_html/abc/lib/Varien/File/Transfer/Adapter/Http.php:96
Stack trace:
#0 /home/xyz/public_html/abc/get.php(205): Varien_File_Transfer_Adapter_Http->send('/home/customerd...')
#1 /home/xyz/public_html/abc/get.php(165): sendFile('/home/customerd...')
#2 {main}
thrown in /home/xyz/public_html/abc/lib/Varien/File/Transfer/Adapter/Http.php on line 96
[01-Jan-2020 10:06:44 UTC] PHP Fatal error: Unsupported operand types in /home/xyz/public_html/abc/app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php on line 948
In that line in base code:
$dataRow += $stockItemRows[$productId];
I guess the $dataRow or $stockItemRows[$productId] is an unsupported data type for addition. Eg: array, empty, null...
Try to debug it writing to log the values of $dataRow and $stockItemRows[$productId] data before the addition to see what happens.

Argument 3 passed to MongoDB\Driver\Server::executeBulkWrite() must be an instance of MongoDB\Driver\WriteConcern or null

I got an error from mongo db, when I connect with application server through php 7.2,**
Fatal error: Uncaught TypeError: Argument 3 passed to MongoDB\Driver\Server::executeBulkWrite() must be an instance of MongoDB\Driver\WriteConcern or null, array given in /var/www/html/project/apps/vendor/mongodb/mongodb/src/Operation/InsertOne.php:134 Stack trace: #0 /var/www/html/project/apps/vendor/mongodb/mongodb/src/Operation/InsertOne.php(134): MongoDB\Driver\Server->executeBulkWrite('project.app_fe...', Object(MongoDB\Driver\BulkWrite), Array) #1 /var/www/html/project/apps/vendor/mongodb/mongodb/src/Collection.php(931): MongoDB\Operation\InsertOne->execute(Object(MongoDB\Driver\Server)) #2 /var/www/html/project/apps/api/appFeedback.php(75): MongoDB\Collection->insertOne(Array) #3 {main} thrown in /var/www/html/project/apps/vendor/mongodb/mongodb/src/Operation/InsertOne.php on line 134

PHP _COOKIE var gets undefined (the whole var, not an index)

We have developed an API with Symfony3 with a MySQL DB for the persistence. We are running this on Wamp (Apache 2.4, MySQL 5.6, PHP 7.0.10).
The API works well most of the time but, sometimes, after a restart, the bootstrap.php.cache throws an exception caused by this notice:
PHP Notice: Undefined variable: _COOKIE in ....
Here is the entire stack trace coming from the Symfony bowels:
14-Feb-2017 07:36:29 UTC PHP Notice: Undefined variable: _COOKIE in C:\xxx\wamp\www\xxx\var\bootstrap.php.cache on line 453
14-Feb-2017 07:36:29 UTC PHP Fatal error: Uncaught TypeError: Argument 4 passed to Symfony\Component\HttpFoundation\Request::createRequestFromFactory() must be of the type array, null given, called in C:\xxx\wamp\www\xxx\var\bootstrap.php.cache on line 453 and defined in > > C:\xxx\wamp\www\xxx\var\bootstrap.php.cache:1268
Stack trace:
#0 C:\xxx\wamp\www\xxx\var\bootstrap.php.cache(453): Symfony\Component\HttpFoundation\Request::createRequestFromFactory(Array, Array, >Array, NULL, Array, Array)
#1 C:\xxx\wamp\www\xxx\web\app.php(15): Symfony\Component\HttpFoundation\Request::createFromGlobals()
#2 {main}
And this is the line where the stack begins:
$request = self::createRequestFromFactory($_GET, $_POST, array(), $_COOKIE, $_FILES, $server);
It's something strange because, from the stack trace I can know that $_GET, $_POST, and $_FILES are Arrays, but $_COOKIE is not...
Why this var is getting undefined?

Laravel 5.1 : Error on install new

When I am running laravel new blog or any name, I get the following error:
Crafting application...
PHP Fatal error: Uncaught TypeException: Argument 2 passed to GuzzleHttp\Adapter\StreamAdapter::createResponseObject() must be of the type array, null given, called in C:\Users\Felix\AppData\Roaming\Composer\vendor\guzzlehttp\guzzle\src\Adapter\StreamAdapter.php on line 67 and defined in C:\Users\Felix\AppData\Roaming\Composer\vendor\guzzlehttp\guzzle\src\Adapter\StreamAdapter.php:71
Stack trace:
#0 C:\Users\Felix\AppData\Roaming\Composer\vendor\guzzlehttp\guzzle\src\Adapter\StreamAdapter.php(67): GuzzleHttp\Adapter\StreamAdapter->createResponseObject(Object(GuzzleHttp\Message\Request), NULL, Object(GuzzleHttp\Adapter\Transaction), Object(GuzzleHttp\Stream\Stream))
#1 C:\Users\Felix\AppData\Roaming\Composer\vendor\guzzlehttp\guzzle\src\Adapter\StreamAdapter.php(52): GuzzleHttp\Adapter\StreamAdapter->createResponse(Object(GuzzleHttp\Adapter\Transaction))
#2 C:\Users\Felix\AppData\Roaming\Composer\vendor\guzzlehttp\guzzle\src\Client.php(193): GuzzleHttp\Adapter\StreamAdapter->send(Object(GuzzleHttp\Adapter\Transaction)) #3 C:\U in C:\Users\Felix\AppData\Roaming\Composer\vendor\guzzlehttp\guzzle\src\Adapter\StreamAdapter.php on line 71
Fatal error: Uncaught TypeException: Argument 2 passed to GuzzleHttp\Adapter\StreamAdapter::createResponseObject() must be of the type array, null given, called in C:\Users\Felix\AppData\Roaming\Composer\vendor\guzzlehttp\guzzle\src\Adapter\StreamAdapter.php on line 67 and defined in C:\Users\Felix\AppData\Roaming\Composer\vendor\guzzlehttp\guzzle\src\Adapter\StreamAdapter.php:71
Stack trace:
#0 C:\Users\Felix\AppData\Roaming\Composer\vendor\guzzlehttp\guzzle\src\Adapter\StreamAdapter.php(67): GuzzleHttp\Adapter\StreamAdapter->createResponseObject(Object(GuzzleHttp\Message\Request), NULL, Object(GuzzleHttp\Adapter\Transaction), Object(GuzzleHttp\Stream\Stream))
#1 C:\Users\Felix\AppData\Roaming\Composer\vendor\guzzlehttp\guzzle\src\Adapter\StreamAdapter.php(52): GuzzleHttp\Adapter\StreamAdapter->createResponse(Object(GuzzleHttp\Adapter\Transaction))
#2 C:\Users\Felix\AppData\Roaming\Composer\vendor\guzzlehttp\guzzle\src\Client.php(193): GuzzleHttp\Adapter\StreamAdapter->send(Object(GuzzleHttp\Adapter\Transaction)) #3 C:\U in C:\Users\Felix\AppData\Roaming\Composer\vendor\guzzlehttp\guzzle\src\Adapter\StreamAdapter.php on line 71
I don't understand how this can happen. Here is my PhpInfo file
Thanks
The answer was simple. I was running PHP CLI from PHP7 and not XAMPP/PHP5. Only have to uncomment the extension=php_curl.dll line.

Categories