imageantialias doesn't seem to work using PHP 5.
PHP Fatal error: Call to undefined function imageantialias()
The packages php5-gd and libjpeg62 were already installed and I even installed php5-imagick and restarted apache. Still I can't use the GD library under PHP 5.
I tried approaches that were described in forums and on StackOverflow, but I just can't get GD running. I am using the latest release (8.3) of Debian.
On additional research, php -m shows that gd is loaded. However, I didn't see the files libjpeg.so.* in /usr/lib. Maybe this is the problem?
Also, according to phpinfo, GD seems to be installed
How do I install GD for PHP 5?
Package php5-gd is working. Only imageantialias() is not implemented in the PHP packages in Debian Jessie. If you try any other function from the GD library it should work.
The reason behind php5-gd in Debian Jessie not providing that function is explained at bugs.debian.org (closed as "won't fix"). I don't understand it enough to give a summary.
Not in the scope of the question and because of that I won't quote it here, but you may be interested in it anyway: In the same bug report someone wrote down a solution that can be found at forums.debian.net.
This issue at the official dglib repo may be of interest, too: https://github.com/libgd/libgd/issues/115
Related
First of all, I'm sorry if I'm posting a duplicated question. I know there are a few threads about installing imagick on an local machine. But I really can't find any way to fix my php installation.
I want to install the imagick extension for PHP 8.0 But when I try to install with the pecl install imagick command I get the following error:
No releases available for package "pecl.php.net/imagick"
install failed
I am developing on a Macbook. Have a freshly installed Laravel Valet installation. Installed my PHP 8.0 (with homebrew, via valet) and tried to execute pecl install imagick.
I have re-installed imagick & pkg-config with brew reinstall imagick & brew reinstall pkg-config. In that order. After that, I still get the same report.
I have ran brew doctor but don't think there is anything useful in there that could help me. Only some broken symlinks and Unbrewed header files. If you want I can upload the full output, but someone needs to help/tell me how to upload such a big snippet. Just putting it in this question without formatting seems like a bit too much.
Possible duplicated that didn't help me so far:
pecl can't find imagick package
For me it solved with sudo pecl install imagick but that might not be the preferred route.
My php version is PHP 7.4.7 and my distro is lsb_release -a gives me
No LSB modules are avaliable
Distributor ID: TurnKey
Description: TurnKey GNU/Linux 9.12 (stretch)
Release: 9.12
Codename: stretch
and if I try to run the command sudo pecl install sqlsrv This is the output that I get
[root#360 ~]# sudo pecl install sqlsrv
downloading sqlsrv-5.8.1.tgz ...
Starting to download sqlsrv-5.8.1.tgz (186,879 bytes)
........................................done: 186,879 bytes
PHP Parse error: syntax error, unexpected end of file,
expecting function (T_FUNCTION) or const (T_CONST) in /usr/share/php/Archive/Tar.php
on line 2383
what do I need to do in order to install this module?
I'm totally unfamiliar with MS SQLserver, and PHP is not a language I have a lot to do with. But I'm intimately familiar with TurnKey, so let me have a crack at getting you going in the right direction! :)
Firstly TBH, I'm not sure whether your support question is a good fit for a Q&A site like this (at least not without much more info about the customisations that you've made and the steps previous to the issue where you find yourself). Regardless, I'll have a crack.
It's probably also worth noting that just in case it's nor clear, your current server is TurnKey v15.x - based on Debian 9/Stretch.
A quick google bought me to the MS docs which note there are some prerequisites. I'm not sure if these are related to your issue, but to ensure we're on the same page, please ensure that you have followed the relevant steps for Debian. I.e. as noted in these links:
https://learn.microsoft.com/en-au/sql/connect/php/installation-tutorial-linux-mac?view=sql-server-2017#installing-the-drivers-on-debian-8-9-and-10
https://learn.microsoft.com/en-au/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-2017#debian17
You also didn't note how/where you installed PHP 7.4 from? I'm assuming that you installed via https://deb.sury.org/ i.e. followed the Debian steps here: https://packages.sury.org/php/README.txt
Assuming so, then I also suggest making sure that you have the latest version of PEAR installed (i.e. the one from Ondřej Surý's repo and not the one from Debian). If you want to check, try this:
apt policy php-pear
The Debian Streth version is currently 1.10.1 (full string: "1:1.10.1+submodules+notgz-9+deb9u1"). From what I can gather, the version from sury.org should be 1.10.9 (full string: "1:1.10.9+submodules+notgz-1+0~20191119.13+debian9~1.gbp296d25").
And/or installing like this should do the trick (if you have everything else already set up - probably worth double checking afterwards):
apt update
apt install php-pear
A bit more googling suggests that once you have all that sorted and if you still get that same issue, then try reinstalling Archive_Tar before retrying again:
pear install Archive_Tar
If you still have issues after that, unfortunately, I'm out of ideas. Although it's probably worth reporting the issue to MS? The issue tracker for the msphpsql code is here: https://github.com/microsoft/msphpsql/issues
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.
Recently upgraded PHP and ran into the following error message while updating:
php_msgpack_serialize in Unknown on line 0
So first of all, never heard of this package. All searches for this package leads to a single PECL repo (which really doesn't mean anything either) - which has about zero mentions from the community.
A few more searches and I tracked the origin down to a repo for php-memcached-dev - a repository I've never seen or heard of.
Of course, I have heard of the actual memcached library repo: libmemcached
I tried looking for this module everywhere for a sign of it being a legit part of centos but i can't seem to get any good/reliable results.
Places I searched for any sign of this package and/or repository:
http://pkgs.org/
http://stackoverflow.com
http://php.net
http://centos.org
Just searched https://bugs.php.net too...
I don't want to seem paranoid here, but I'm not even sure if this is legit at this stage.
Shrug - I dunno. I'm keeping my server turned off though until I see something else. Anyone have some advice/input ?
For the paranoid (and yes, I found it from being a little bit myself), here is an ugly google search : php_msgpack backdoor (note: only has 2 3 search results. Check out the date in the 2nd 3rd. i haven't clicked it myself and would not recommend anyone else click it either) This seems to be a rkhunter search looking for the same file being reported above. Probably just a coincidence but who knows. Thought I'd push it out there anyways.
UPDATE: Well, long story short this turned out to be an issue with a version of PHP that was installed with Cent. It has been fixed with the latest version.
On Ubunu 16.04 with PHP 5.5 from the Ondrej-PPA (https://launchpad.net/~ondrej/+archive/ubuntu/php) I could solve the problem by installing the package php-msgpack:
sudo apt-get install php-msgpack
And than enabling the php-msgpack with
sudo phpenmod msgpack
Perhaps you ave to restart apache2 after that if you use it with PHP.
Than this error is gone:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20121212/memcached.so' - /usr/lib/php/20121212/memcached.so: undefined symbol: php_msgpack_serialize in Unknown on line 0
One last thing to check:
msgpack extension must be loaded before memcached.
In my scenario extensions were loaded alphabetically and therefore memcached was loaded before msgpack. Php cli didn't work until I loaded msgpack before memcached.
Following commands solved my issue.
sudo apt-get install php-igbinary
sudo apt-get install php-msgpack
sudo service php7.3-fpm reload #Change to your version
Reference:
https://laracasts.com/discuss/channels/forge/php-71-update-broken-memcached
If you land here in Oct 2020 because you're getting an error after upgrading and you're using the repository ppa:ondrej/php you need to install the specific version of msgpack because all-of-a-sudden memcached is looking for this shared object.
We're running php 7.3 from this repo and although php-msgpack was installed, we needed to install php7.3-msgpack (which wasn't needed until this upgrade). No need to "enable" it as mentioned in the accepted answer. Just restart php.
Two steps:
sudo apt install php7.3-msgpack
sudo systemctl restart php7.3-fpm.service
http://msgpack.org/
http://pecl.php.net/package/msgpack
https://code.google.com/p/php-msgpack/
If your codebase doesn't use MsgPack, you can remove it from the php.ini and/or smaller files that mention it in the php.d/* subdirectories.
Well, long story short this turned out to be an issue with a version of PHP that was installed with Cent. It has been fixed with the latest version.
I have installed the latest release of ImageMagick (ImageMagick 6.8.5-10 2013-06-05 Q16)
Along with the pecl package Imagick version 3.1.0RC2
Installation appeared to be a complete success and I now have an Imagick section showing in phpinfo()
However it shows as having 0 supported file formats. When I check the supported file formats from the command line using ImageMagick directly, they are all there an working. Just not with the php module.
This of course causes problems when trying to use it within PHP. I can instantiate the Imagick object fine:
$im-> new Imagick()
But trying to read a file fails:
$im->readFile('location');
Does anyone have any idea how to fix this?
I am running an Amazon EC2 linux instance with nginx/fcgi/PHP5.4.
Thanks in advance
This is related to a problem with the way how the PHP module of iMagick is installed. I would suggest you revisit your installation and install this properly. Then revisit PHPINFO to confirm that you see all the necessary formats.
Install on Debian
http://rakesh.sankar-b.com/2011/05/25/install-imagemagick-from-source-in-debian/
Install on CentOS
http://rakesh.sankar-b.com/2010/07/13/how-to-install-imagemagick-linux-yum/
http://forum.directadmin.com/showthread.php?t=44449