How can I install ID3 support for PHP on Debian? - php

I tried apt-get install php-getid3 and it installs, but when I restart lighttpd and use id3_get_tag() in my script I get the following error
Fatal error: Call to undefined function id3_get_tag() in x.php on line 3
I thought this was odd since usually the packages are php5-gd or php5-mysql and not just php-
I even tried installing the package id3 as well and restarting lighttpd but that didn't work either.
I'd rather not have to compile PHP myself if it can be avoided.

Related

I get a undefined curl_version() function in php

I added Paypal Express checkout plugin to my website.
I get this error:
2019-07-23T15:45:32+00:00 CRITICAL Uncaught Error: Call to undefined
function PayPal\Core\curl_version() in
/var/www/html/wp-content/plugins/woo-paypal-express-checkout/includes/php-library/paypal-rest/lib/PayPal/Core/PayPalHttpConfig.php:65
and this is the line
$curl = curl_version();
What can I do to resolve this probleme
I tried to install php-curl but I always got the same result
I used
sudo apt-get install php5-curl
sudo service apache2 restart
It sounds like you are missing the PHP CURL extension. This is usually bundled as a separate package. If you are using Ubuntu, apt-get install php-curl (or php7.2-curl) will install the missing dependency. You may need to enable the module after installing it using phpenmod curl. If you are using another Linux distribution, please consult the appropriate distribution documentation for installing PHP modules.
First, check your active PHP version, maybe there are multiple PHP versions installed on the server. In that case, you have to look for an active PHP version running on the server. Use phpinfo(); to check PHP version. Then run the command as per your PHP version. In my case, it was PHP 7.3.
$ sudo apt-get install php7.3-curl
$ sudo service apache2 restart

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..

imagecreatefromjpeg not working after upgrading ubuntu to xenial

After following these instructions
I still get:
Fatal error: Uncaught Error: Call to undefined function imagecreatefromjpeg()
Checking php_info, GD is enabled already in my php 7.0 installation... any clues?
I had an Ubuntu 14.04 and after doing a release upgrade to 16.04 everything went nuts, and even after apt-get install php7.0-gd it is not working :(.
Edit:
Actually I see this on my info: GD imaging In module authors, but there is no actual GD section on the php_info() output, so something seems to be wrong with the process I followed and even tho I apt-get install php7.0-gd, it is not completely enabled? I'm checking.
Ok, so stupid me, I thought module was enabled because apt-get went fine and I saw that GD imaging line on the php_info() output.
But actually the php_gd2 module was not enabled on my php.ini file, after double checking that and restarting apache everything works fine... sorry about that.

intl and PHP 5.4.24 on OSX 10.9

I tried to use idn_to_ascii() function with the pre installed PHP instance of Max OSX 10.9.4 (which is 5.4.24).
I read through lot of Stackoverflow questions and in the most of them they say: intl is precompiled since PHP 5.3 and you don't need an extension and it works out of the box.
But why are the intl functions not available in this PHP instance then? I just get a
Fatal error: Call to undefined function idn_to_ascii() in /path/test.php on line 3
Also I tried it with XAMPP 1.8.3-4 on OSX 10.9 with PHP 5.5.x and I also get
Fatal error: Call to undefined function idn_to_ascii() in /Applications/XAMPP/xamppfiles/htdocs/test.php on line 3
Is this a problem with OSX or are there problems with both instances of PHP?
intl is bundled with the PHP source code, but must be enabled using the --enable-intl compile-time option. This is apparently not the case for those two PHP installations. You can check using php -i | grep intl. You'll probably have to go with the PECL installation method. Alternatively I'd recommend maintaining your own flexible PHP installation with homebrew's homebrew-php tap.
The problem also occures on Debian 7.9 too and you can install php5-intl package with apt-get to solve it.
I had the same issue on my servers. Unlike the proposed solution here, I had PHP version 7. So I had to install the corresponding intl packages:
For PHP 7.1:
sudo apt-get install php7.1-intl
For PHP 7.0
sudo apt-get install php7.0-intl

Installing PECL extension error

I downloaded a PECL extension and executed:
$ phpize
$ ./configure
The following command generated dozens of errors:
$ make
I suspect that the first two errors lead to the others:
/Users/afilina/Downloads/APC-3.1.9/apc.h:61:17: error: php.h: No such file or directory
/Users/afilina/Downloads/APC-3.1.9/apc.h:62:30: error: main/php_streams.h: No such file or directory
Here is an example of the dozens of syntax errors:
/Users/afilina/Downloads/APC-3.1.9/apc.h:69: error: syntax error before 'TSRMLS_DC'
Does anyone have pointers as to what might have happened? Installing using the "pecl" command is not an option as my PEAR installation is corrupted.
You need the PHP headers. Depending the Distro, or OS these may be found in a different manner.
In debian you need install "php5-dev":
apt-get install php5-dev
Realy i don't know how install it in Mac.

Categories