I have custom WordPress plugin where I giving option for admins to download export of survey. The plugin using package phpoffice
I have test hosting with PHP 7.3 where export goes well and the production hosting is on PHP 7.3.3 (before it was PHP 7.4) where the exactly same problem does not work.
I'm expecting to resolve this error and make the option for download exports working..
I've tried searching for google but I didn't find solution exactly for my problem.
I tried this stuffs:
Upgrade memory_limit from 256MB to 512MB
Tried to downgrade production hosting PHP version from 7.4 to 7.3.3
When production hosting PHP version was 7.4 it gived this error in PHP error log:
[22-Dec-2022 08:45:24 UTC] PHP Fatal error: Uncaught Error: Interface 'Psr\SimpleCache\CacheInterface' not found in /www/doc/www.digitalniagora.cz/www/wp-content/plugins/agora_survey/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/Memory.php:14
Stack trace:
#0 /www/doc/www.digitalniagora.cz/www/wp-content/plugins/agora_survey/vendor/composer/ClassLoader.php(571): include()
#1 /www/doc/www.digitalniagora.cz/www/wp-content/plugins/agora_survey/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile('/www/doc/www.di...')
#2 [internal function]: Composer\Autoload\ClassLoader->loadClass('PhpOffice\\PhpSp...')
#3 /www/doc/www.digitalniagora.cz/www/wp-content/plugins/agora_survey/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Settings.php(164): spl_autoload_call('PhpOffice\\PhpSp...')
#4 /www/doc/www.digitalniagora.cz/www/wp-content/plugins/agora_survey/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/CellsFactory.php(19): PhpOffice\PhpSpreadsheet\Settings::getCache()
#5 /www/doc/www.digitalniagora.cz/www/wp-content/ in /www/doc/www.digitalniagora.cz/www/wp-content/plugins/agora_survey/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/Memory.php on line 14
After I downgraded the PHP version to 7.3.3 (because I haven't option to downgrade to PHP 7.3) I getting just this error:
[27-Dec-2022 15:43:23 UTC] PHP Fatal error: Interface 'Psr\SimpleCache\CacheInterface' not found in /www/doc/www.digitalniagora.cz/www/wp-content/plugins/agora_survey/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/Memory.php on line 14
EDIT 29.12.2022:
I tried update PHP version on test hosting to the same version as production hosting is but on test version it working well and production version code does not work.
But the code is exactly same as on test hosting where everything works well and also the code is exactly same after downgrade PHP version..
Can anybody give me some hints to find the solution?
Related
I have a newly cloned phalcon repository:
software: MacOS
Phalcon: 5.0.0RC4
PHP: 8.1
Zephir: 0.16.0
brew: phalcon#4.1.0
Location: ~/Documents/cphalcon
I am trying to set up my new repository by following the tutorial here.
However when I go to my page at localhost:8000, this error pops up:
Fatal error: Uncaught Error: Class "Phalcon\Loader\Loader" not found in /Users/apple/Documents/cphalcon/public/index.php:16 Stack trace: #0 /Users/apple/Documents/cphalcon/.htrouter.php(15): require_once() #1 {main} thrown in /Users/apple/Documents/cphalcon/public/index.php on line 16
I found some similar thread and they said to check my phpinfo to see if phalcon is there, and it was.
I checked for more materials but couldn't find any other clues.
I also tried changing the call to:
use Phalcon\Loader;
But it was the same
Fatal error: Uncaught Error: Class "Phalcon\Loader" not found in /Users/apple/Documents/cphalcon/public/index.php:16 Stack trace: #0 /Users/apple/Documents/cphalcon/.htrouter.php(15): require_once() #1 {main} thrown in /Users/apple/Documents/cphalcon/public/index.php on line 16
Any clues?
I believe that in version 5 the proper syntax now is Phalcon\Autoload\Loader().
Since Phalcon 5 is still in Release Candidate mode (hence the "RC4" on the version), the docs are still lagging a bit behind.
I've converted a couple of Phalcon 3 and 4 sites, and I found the Phalcon 5.0.0RC4 ChangeLog to be helpful when moving from Phalcon 4 to 5. The move from 3 to 5 is far more involved and requires finding the Phalcon 4 update doc on the Phalcon web site.
I hope this helps.
Using laravel v8.7*
Using apache server and used deployer to deploy the Laravel application on the server.
Having issues once deployed to a server.
I get the following error:
PHP Fatal error: Uncaught Error: Call to undefined method Illuminate\Support\Collection::getArrayableItems() in /var/www/html/releases/2/vendor/laravel/framework/src/Illuminate/Collections/Collection.php:31\n
Stack trace:\n
#0 /var/www/html/releases/2/vendor/laravel/framework/src/Illuminate/Collections/helpers.php(15): Illuminate\Support\Collection->__construct(Array)\n#1 /var/www/html/releases/2/vendor/laravel/framework/src/Illuminate/Support/Traits/ReflectsClosures.php(49): collect(Array)\n
#2 /var/www/html/releases/2/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/ReportableHandler.php(62): Illuminate\Foundation\Exceptions\ReportableHandler->firstClosureParameterTypes(Object(Closure))\n
#3 /var/www/html/releases/2/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(234): Illuminate\Foundation\Exceptions\ReportableHandler->handles(Object(Symfony\Component\ErrorHandler\Error\FatalError))\n
#4 /var/www/html/releases/2/vendor/laravel/framework/src/Illuminate/Foundati in /var/www/html/releases/2/vendor/laravel/framework/src/Illuminate/Collections/Collection.php on line 31
Used the following instructions to deploy Note: using apache server over ngnix as apache is currently running other applications on the server.
Have you checked if the PHP version on the droplet is the same as the PHP version you have been using locally? This looks like an error that will occur if you change versions between PHP / Laravel.
I developed a WordPress site for running on IIS with PHP FastCGI, that works.
I found that website is so slow, so tried to test it under Apache.
Now I have an installed WordPress site, IIS, Apache and 2 different php installation.
1 PHP is Non-Thread-Safe PHP (V7.4.9) that will be called by IIS FastCGI module and works correctly.
Another is ThreadSafe PHP (V7.4.9) that will be called from Apache and works but not for mysql.
When I execute code under Apache (localhost:81) it produces below error:
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in D:\Website\wp-includes\wp-db.php:1670
Stack trace:
#0 D:\Website\wp-includes\wp-db.php(632): wpdb->db_connect()
#1 D:\Website\wp-includes\load.php(476): wpdb->__construct('DB_USER_VAL', 'DB_PASS_VAL', 'DB_NAME_VAL', '127.0.0.1')
#2 D:\Websites\Navand\wp-settings.php(124): require_wp_db()
#3 D:\Website\wp-config.php(92): require_once('D:\\Website...')
#4 D:\Website\wp-load.php(37): require_once('D:\\Website...')
#5 D:\Website\wp-blog-header.php(13): require_once('D:\\Website...')
#6 D:\Website\index.php(17): require('D:\\Website...')
#7 {main} thrown in D:\Website\wp-includes\wp-db.php on line 1670
Note:
Apache PHP works correctly when calling phpinfo()
extension_dir has been set for both php installations
both php_mysql and pdo_mysql are enabled for both php installation
both php.ini files are same (checked by WinMerge)
Why calling same mysql functions on Apache and TS-PHP generates error, but works correctly on IIS? and how can I resolve this problem (as I can not change WordPress source)
Surprise!
According to answer https://stackoverflow.com/a/14786808/1441476, using absolute extension dir in php.ini for version that runs under apache, worked for me (extension_dir = "C:/Programs/php/php-7.4.9-Win32-vc15-x64/ext" instead of extension_dir = "ext")
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 installed LAMP on centos7 with php 7.
Then I installed Laravel using composer but I get error 500 in the browser and the following error in apache:
PHP Fatal error: Uncaught RuntimeException: PHP's json extension is required to use Monolog's NormalizerFormatter in /var/www/html/blog/vendor/monolog/monolog/src/Mon$PHP
Fatal error: Uncaught RuntimeException: PHP's json extension is required to use Monolog's NormalizerFormatter in /var/www/html/blog/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php:34
Stack trace:\n#0 /var/www/html/blog/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php(42): Monolog\Formatter\\NormalizerFormatter->__construct(NULL)
#1 /var/www/html/blog/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php(184): Monolog\\Formatter\LineFormatter->__construct()
#2 /var/www/html/blog/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php(112): Monolog\\Handler\\AbstractHandler->getDefaultFormatter()
#3 /var/www/html/blog/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(35): Monolog\\Handler\\AbstractHandler->getFormatter()
#4 /var/www/html/blog/vendor/monolog/monolog/src/Monolog/Logger.php(337): Monolog\\Handler\\AbstractProcessingHandler->handle(Array)
#5 /var/www/html/blog/vendor/monolog/monolog/src/Monolog/Logger.php(616): Monolog\\Logger->addRecord(400, Objec in /var/www/html/blog/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php on line 34
Can anybody please point me to the right direction?
Laravel 5.3, 5.2, 5.1 ,5.0 and lower are not supported yet by PHP 7.
Hope newer version will support the php 7