GD library is still missing after I installed it - php

So I am creating a website for my virtual airline for xplane-11, and I came across this error:
Fatal error: Uncaught Exception: Required GD library is missing in /var/www/html/vam/captcha/simple-php-captcha.php:13 Stack trace: #0 /var/www/html/vam/index.php(15): simple_php_captcha() #1 {main} thrown in /var/www/html/vam/captcha/simple-php-captcha.php on line 13
I have libgd-dev installed on my ubuntu 20.04 and I also have all the extensions uncommented in my php.ini file in the etc/apache2/sites-available folder. I am really frustrated at this point and any help given will be thanked.

From the command line what do you get if you run
php -m | grep -i gd
If it returns
gd
Then the module is included and running in your version of PHP.
Otherwise I would try the following
apt-get install php-gd
Then run the php -m | grep -gd command again after restarting apache

Related

How to rectify Call to undefined function Symfony\Component\Console\Helper\mb_detect_encoding() after installing composer?

I am using ubuntu 21.04 in that i installed composer by using this command sudo apt-get install composer ,after installing i type composer it's showing following error
HP Fatal error: Uncaught Error: Call to undefined function Symfony\Component\Console\Helper\mb_detect_encoding() in /usr/share/php/Symfony/Component/Console/Helper/Helper.php:50
Stack trace:
#0 /usr/share/php/Symfony/Component/Console/Descriptor/TextDescriptor.php(329): Symfony\Component\Console\Helper\Helper::strlen('h')
#1 /usr/share/php/Symfony/Component/Console/Descriptor/TextDescriptor.php(97): Symfony\Component\Console\Descriptor\TextDescriptor->calculateTotalWidthForOptions(Array)
#2 /usr/share/php/Symfony/Component/Console/Descriptor/TextDescriptor.php(197): Symfony\Component\Console\Descriptor\TextDescriptor->describeInputDefinition(Object(Symfony\Component\Console\Input\InputDefinition), Array)
#3 /usr/share/php/Symfony/Component/Console/Descriptor/Descriptor.php(55): Symfony\Component\Console\Descriptor\TextDescriptor->describeApplication(Object(Composer\Console\Application), Array)
#4 /usr/share/php/Symfony/Component/Console/Helper/DescriptorHelper.php(67): Symfony\Component\Console\Descriptor\Descriptor->describ in /usr/share/php/Symfony/Component/Console/Helper/Helper.php on line 50
please help me to fix this issue
You simply enable mbstring extension it will remove the uncaught error
sudo apt-get install php7.2-mbstring
If you're using PHP 7.4:
sudo apt-get install php7.4-mbstring
Check phpinfo.php for ctype module information. In my case, it wasn't loaded and I didn't see the following:
I activated it in php.ini (location depends on your configuration):
;extension=curl
extension=ctype # uncomment or add this
;extension=ffi
and restart php service. You should see ctype module's block and error should go away.

MongoDB PHP driver not working on Ubuntu AWS

I'm trying to install the MongoDB PHP driver Using PHP 7.2 on AWS EC2 Ubuntu.
I used sudo pecl install mongodb. it seems to have installed without any errors.
However, when loading phpinfo() I don't see any reference to Mongo. When I try to run:
$manager = new MongoDB\Driver\Manager("mongodb://localhost:27017");
Fatal error: Uncaught Error: Class 'MongoDB\Driver\Manager' not found in /var/www/html/website/test.php:3 Stack trace: #0 {main} thrown in /var/www/html/website/test.php on line 3
I did put in extension=mongodb.so into my php.ini
I'd appreciate assistance as to why this isn't working.
I tried to install driver using
sudo apt-get install php-mongodb
and it works.

How to install IoncubeLoader on MacOS 10.13

I can not get the IoncubeLoader running on my MacOS 10.13.
First I tried - as recommended - to install via loader-wizard. This fails with the error message:
Warning: Illegal string offset 'errors' in
/Users/johndoe/Sites/ioncube/loader-wizard.php on line 1252
Fatal error: Uncaught Error: Cannot use string offset as an array in
/Users/johndoe/Sites/ioncube/loader-wizard.php:1252 Stack
trace: #0 /Users/johndoe/Sites/ioncube/loader-wizard.php(1294):
scan_inis_for_loader() #1
/Users/johndoe/Sites/ioncube/loader-wizard.php(3291):
find_loader(false) #2
/Users/johndoe/Sites/ioncube/loader-wizard.php(3085):
ini_loader_errors() #3
/Users/johndoe/Sites/ioncube/loader-wizard.php(2908):
loader_not_installed() #4
/Users/johndoe/Sites/ioncube/loader-wizard.php(2712):
default_page() #5
/Users/johndoe/Sites/ioncube/loader-wizard.php(115): run() #6
{main} thrown in /Users/johndoe/Sites/ioncube/loader-wizard.php
on line 1252
Then I tried to copy it manually to the extension folder; this fails because of the missing rights (although I use the admin account):
$ sudo cp ioncube/ioncube_loader_dar_7.1.so
/usr/lib/php/extensions/no-debug-non-zts-20160303/
$ cp: /usr/lib/php/extensions/no-debug-non-zts-20160303/ioncube_loader_dar_7.1.so:
Operation not permitted
Next I installed the IoncubeLoader via homebrew. This seems to have worked at first glance:
$ brew search ioncube
==> Searching local taps...
homebrew/php/php71-ioncubeloader ✔
... but php -v doesn't show any installed IoncubeLoader extension, neither does phpinfo().
What more can I do to get Ioncube Loader running? Is there a reference to the homebrew installed loader missing? I am thankful for every hint!
I just used another way to solve the problem in my case. I am using MacOS High Sierra 10.13
I created a folder under the sudo mkdir /etc/apache2/my_extensions
Then I moved the ioncube extensions downloaded from ioncube.com
I copied the downloaded ioncube extensions to the new folder I created like so
sudo cp /Users/YOUR_USERNAME/Desktop/ioncube/* /etc/apache2/my_extensions
I had already extracted the compressed ioncube package to a folder called ioncube on my Desktop.
After that, I restarted apache using sudo apachectl restart
Then my ioncube issue was solved. Let me know if this helps.

Class 'Stomp' not found

I am using PHP 7.0 with Apache2 in Ubuntu trusty.
I have installed the STOMP library doing
wget http://pecl.php.net/get/stomp-2.0.0.tgz
pear install stomp-2.0.0.tgz
And adding extension=stomp.so to my php.ini.
With phpinfo() I can see the Stomp installed correctly:
But I have this script:
<?php
$foo = new Stomp('tcp://localhost:61613');
And When I run this error is shown:
PHP Fatal error: Uncaught Error: Class 'Stomp' not found in
/vagrant/www/web/activemq-server.php:3 Stack trace:
0 {main} thrown in /vagrant/www/web/activemq-server.php on line 3
UPDATE:
This problem happens only when the script is run from console. If the script is run from browser then it works correctly.
Did you add the extension to php.ini for the CLI too ?
You can type " php -i | grep -i stomp " in the console to know if the extension is enabled
Check the namespace.
$foo = new \Stomp('tcp://localhost:61613');

PHP Issue with PHAR and ZLIB

I'm trying to install phpbrew on my system.
Ubuntu Server Raring Ringtail 13.04 x64
I downloaded the file from GitHub
It has all permissions set, but everytime i try to decompress and install the phar file it throws me this error:
kkoci#ubuntuweb:~/phpbrew$ php -c /etc/php5/cli/php.ini phpbrew
PHP Fatal error: Uncaught exception 'PharException' with message 'zlib extension is required for gz compressed .phar file "/home/kkoci/phpbrew/phpbrew"' in /home/kkoci/phpbrew/phpbrew:3
Stack trace:
#0 /home/kkoci/phpbrew/phpbrew(3): Phar::mapPhar('phpbrew.phar')
#1 {main}
thrown in /home/kkoci/phpbrew/phpbrew on line 3
zlib extension is already enabled, on web version (apache) of php and on cli as well.
These are the interesting lines of the phpbrew phar
#!/usr/bin/env php
<?php
Phar::mapPhar('phpbrew.phar');require 'phar://phpbrew.phar/Universal/ClassLoader/SplClassLoader.php';
$classLoader = new \Universal\ClassLoader\SplClassLoader;
$classLoader->addFallback( 'phar://phpbrew.phar' );
$classLoader->register();require 'phar://phpbrew.phar/scripts/phpbrew- emb.php';__HALT_COMPILER(); ?>
Please, i can't figure out how to bypass this, as i wrote before, everything is enabled, zlib and phar, i don't know, maybe i'm missing some phar configuration?
Same problem, fixed it doing a configure --with-zlib --with-zlib-dir=/ext/zlib
and then a make install

Categories