PHP Issue with PHAR and ZLIB - php

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

Related

GD library is still missing after I installed it

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

Unable to generate pdf on server side in NGNIX

I am using Dompdf (v-0.8.2) to generate pdf on the server-side. My server is NGINX and I am using CodeIgniter 2.41 (PHP framework) for PDF generation.
PDF is being generated in the localhost without any errors whatsoever.
But when I try to generate the same pdf on the server side it gives this error,
[error] 31558#31558: *4 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error:
Call to undefined function Dompdf\mb_internal_encoding() in
/application/libraries/dompdf/src/Dompdf.php:274
Stack trace:
#0 /application/libraries/Pdf.php(17): Dompdf\Dompdf->__construct()
#1 /system/core/Loader.php(1100): Pdf->__construct()
#2 /system/core/Loader.php(976): CI_Loader->_ci_init_class('pdf', '',
NULL, NULL)
#3 /system/core/Loader.php(217): CI_Loader->_ci_load_class('Pdf', NULL,
NULL)
#4 /application/third_party/HMVC/Loader.php(138): CI_Loader-
>library('pdf', NULL, NULL)
I tried upgrading my dompdf version to 0.8.5. but still the error is not resolving. Does anyone have an idea of how to resolve the error.
Thank you in advance, cheers. :)
mbstring is a "non-default" extension, that is not enabled by default ;
try to install or enabled mbstring extension
sudo apt-get install php(version)-mbstring
ex.: sudo apt-get install php7.3-mbstring
for enabling extension use sudo phpenmod mbstring

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.

How To Install PECL YAML Extension on Mac?

My goals is to be able to use the PHP functions for parsing YAML detailed in the PHP docs:
http://php.net/manual/en/ref.yaml.php
To install the PECL yaml extension I've opened Terminal and typed:
brew install libyaml
Then
sudo /usr/local/php5/bin/pecl install pecl_http
Then
sudo /usr/local/php5/bin/pecl install yaml
But I think it fails to install the PECL yaml extension. It says:
3 warnings and 16 errors generated.
make: *** [yaml.lo] Error 1
ERROR: `make' failed
And when I try to use yaml_parse_file() in my program, it says:
Fatal error: Call to undefined function yaml_parse_file()
How do I properly install the PECL yaml extension so I can use the PHP functions for parsing YAML?
I had similar issue and below steps helped me.
First be sure you have installed yaml extension (as I know since brew will not help us for packages so better to use pecl)
Even though some errors (such as failed for mkdir) occurred during installation it was completed.
pecl install yaml
Next open your php.ini file and add this line according to your path to yaml.so file.
extension=/usr/local/Cellar/php70-yaml/2.0.0/yaml.so
Hope it helps..

Codecept installation gives me an fatal error (bz2 extension)

I am trying to setup Codeception (v1.8) on my local development box (Windows 7 running WAMP).
I have PHP 5.3.13 running and both CURL and bzip2 are enabled modules, when I run the following command to install the 'framework' I get the following error:
php codecept.phar bootstrap
PHP Fatal error: Uncaught exception 'PharException' with message 'bz2 extension is required for bzip2 compressed .phar file "C:\wamp\www\codecept\codecept.phar"' in C:\wamp\codecept\codecept.phar:3
Stack Trace:
#0 C:\wamp\www\codecept\codecept.phar(3): Phar::mapPhar()
#1 {main}
thrown in C:\wamp\www\codecept\codecept.phar on line 3
......
I have 5.3 running so haven't installed the latest version of Codecept (v2) as that doesn't work with my version of PHP but cannot be sure why this is happening?
Any ideas
P.S I will be using this Codecept with Yii eventually if that makes any difference
I had the same problem and uncommenting 'extension=bz2.so' in my php.ini file fixed it.
the problem you have is because the v2 of codeception requires at least php5.4, downgrade to some of the 1.x versions than you will have no problem.
Here is the link for the versions

Categories