Call to undefined function apcu_add() - php

I'm currently working on an api which has been developed using Lumen 5.4. I'm trying to run this on my local XAMPP for Linux 7.4.3. But I keep getting the following error,
lumen.ERROR:
Symfony\Component\Debug\Exception\FatalThrowableError:
Call to undefined function xxx\Prometheus\Storage\apcu_add() in
/opt/lampp/htdocs/xxx-api/vendor/xxx/php-prometheus-exporter/src/Storage/APCU.php:78
Current PHP version is 7.4.3. I have installed apcu along with apcu_bc and added the following to php.ini as well,
extension=apc.so
apc.enabled="1"
but I'm not seeing any apc related info in phpinfo.php page.
Any help is appreciated.

Related

Error: Failed to start application: Call to undefined function Joomla\CMS\Language\simplexml_load_file()

I am getting the error mentioned in the question, I am using:
Linux Mint 18
LAMP
Joomla3.5
solr-7
I have already installed the required libraries here are the screenshots:
Screenshot
I reinstalled the module using the synaptic manager and restarted apache but still the error persists.
Please help me in finding the solution.

Call to undefined function simplexml_load_string()

Call to undefined function simplexml_load_string()
I am getting this error on all the sites located on our server. Everything was working correctly until today and all of sudden this error poped up.
I have checked Simplexml and it is already installed on the server. Here is the error:
Fatal error: Call to undefined function simplexml_load_string() in
.../lib/Varien/Simplexml/Config.php on line 510
Had the same problem today. I tried to check whether extension is loaded and I was getting true (from command line) Then I found that I was using multiple php versions and the site in question was using php5.4 which for some reason was failing for simplexml
Since I am in a cPanel/WHM environment I ran
yum install ea-php54-php-simplexml
which fixed the issue. This is for EasyApache4. Perhaps you can just update simplexml sepending on your flavour of linux.
Installing latest extension resolved the issue.
yum install ea-php56-php-simplexml

Class 'DateTimeImmutable' not found

I've just run an update for my CakePHP version (3.1.7). And now I'm unable to run my app, with a fatal error :
Fatal error: Class 'DateTimeImmutable' not found in /opt/lampp/htdocs/my-app/vendor/cakephp/chronos/src/Chronos.php on line 50
I found this issue on Github, where I noticed that
DateTimeImmutable was not present in 5.4
So I install PHP5.6.20 on my PC, but after restarting Xampp, I still get the same error. How can I fix this ?
PHP's installation on the PC is not related to Xampp. So installing PHP doesn't solve the problem. But installing a new version of Xampp with PHP 5.6.
It's a PHP Version Problem make sure You're using PHP > 5.5v

Laravel 5 memcached not found while properly installed

I have PHP 5.4 on a litespeed web server. PHP has been compiled properly with memcached module and we also installed properly memcached library.
In fact the problem suddenly happened without any change at all (server side) when I run the artisan command, I am getting this error:
PHP Fatal error: Class 'Memcached' not found in /laravel/vendor/laravel/framework/src/Illuminate/Cache/MemcachedConnector.php on line 52
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'Memcached' not found
I googled the issue but was unable to find a solution. I am using Laravel 5.0.
I edited the app/Http/Routes.php and returned new Memcached at the top of the file and the php object was returned so it means memcached is properly installed on the server...
Any help would be appreciated.
Found the solution. My problem was when I was running the artisan command, the artisan was using another version of PHP (different than the Litespeed one) and this PHP was not compiled with memcached.

Call to undefined function stats_standard_deviation()

My PHP version is 5.4.16
I found php_stats (and php_http) here:
http://windows.php.net/downloads/pecl/releases/
Got this version: php_stats-1.0.3-5.6-ts-vc11-x86.zip
(Yes I have 32bit)
Copied php_stats.dll to C:\wamp\bin\php\php5.4.16\ext
Add extension=php_stats.dll (and extension=php_http.dll) to php.ini (located in C:\wamp\bin\apache\Apache2.4.4\bin)
exit wamp, start wamp, restart all services
wamp -> php -> php extensions -> php_stats is checked (and php_http)
But I still get the same error (see title). How can I solve this?
Call to undefined function stats_standard_deviation() php pecl stats wamp windows 7
I found another package here:
http://pecl.php.net/package/stats/1.0.3/windows
this one is working

Categories