FFMPEG on Fedora but PHP Compilation confliction - php

I have running Xampp with PHP5.5 on Fedora from Apache Friend, with default settings what the installer package do on Linux.
When I install FFMPEG successfully and try to load from php.ini it always says:
*
11-Oct-2013 14:05:51 Europe/Berlin] PHP Warning: PHP Startup: ffmpeg: Unable to initialize module
Module compiled with module API=20060613
PHP compiled with module API=20121212
These options need to match
in Unknown on line 0
*
The only thing which is confusing me is that when I did phpize even that I already installed xampp server which means I have PHP running. FFMPEG phpize did not work and I had to install php-devel. Does that mean that FFMPEG is configured with PHP, other than the installed with XAMPP? I am not sure what is happening. Whatever I do I always receive this error message in php_error_log file.
It is amazing :) that I just run below command to see what version of PHP is, I have and below are the results which are shocking one because I am in a feeling that I have PHP 5.5 installed and running from XAMMP.
[root#localhost ~]# php -v
PHP 5.2.6 (cli) (built: May 8 2008 08:53:44)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
How can I get this covered that if I simple install XAMPP server on linux and want to install and configure FFMPEG along with?

My guess would be that the versions of php and the module you installed do not match. So run make sure both packages are installed from the same source and are both current.
EDIT: According to the XAMPP site, Fedora is not supported, they specify Ubuntu, SuSE, RedHat, Mandrake and Debian. So I would make sure you do not use the php package provided by Fedora. Or (if you have the liberty), choose a different OS.

Related

Postgresql database with PHP server error on MacOS Bash

I ran a PHP server with postgresql on my college computers which works fine, however on my local machine (which runs MacOS), I get the following error message:
Call to undefined function pg_Connect() in /Users/mac/Documents/<... the remaining path to php file>.php on line 2
Now, I thought it's an issue of missing the postgresql packages for php, so I used brew to install the php postgresql packages. I ran the following commands:
brew install postgresql
brew install php55 --with-postgresql
brew install php55-pdo-pgsql
However, even after running these commands I get the same error when running the php server, i.e.
Call to undefined function pg_Connect() in /Users/mac/Documents/<... the remaining path to php file>.php on line 2
The php version I have is 5.5.30:
mac$ php -v
PHP 5.5.30 (cli) (built: Oct 23 2015 17:21:45)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
Please could you suggest what I am doing wrong to install the packages. I read on stack overflow that the packages can be installed with an apt-get command on linux, however I'm not sure as to what the solution is with the Mac operating system.
Thanks in advance.
The solution was edit the php.ini on your server then find this below line and uncomment that line.
extension="pgsql.so"
then restart the server apache and test it out again.
Also, check this link for the steps regarding installation of the postgress to mac OS.

XDEBUG installation reading wrong PHP version

I have an Ubuntu 16.04 vagrant box running on php 7.1. When I try to build xdebug by running ./configure in xdebug-2.6.0 I get
Check for supported PHP versions... configure: error: not supported. Need a PHP version >= 7.0.0 and < 7.3.0 (found 5.5.9-1ubuntu4.24)
PHP -v yields
Xdebug requires Zend Engine API version 320170718.
The Zend Engine API version 320160303 which is installed, is outdated.
PHP 7.1.15-1+ubuntu14.04.1+deb.sury.org+2 (cli) (built: Mar 6 2018 11:27:08) ( NTS )
So the system is running 7.1, but for some reason the configure script thinks we're still on 5.5.9
I've hit google pretty hard, but still can't find a way to update the Zend engine either.
Any ideas?
It happens because you're configuring with default settings and that is different from the PHP version you're trying to configure.
Just like you saw the PHP version using the php -v command, check the php-config version using the php-config --version command, it should be the same as php -v, but in your case, it would be different and hence this issue.
Now let's talk about how we can solve it. Since you need a different version of config, you should point that to the configure command.
For example, in your case, you need php-config7.1 (because you're using PHP v7.1, similarly for 7.2 you have php-config7.2 and so on)
To point the configure command to a specific PHP version you need to specify that as a flag called with-php-config and the value should be the location of the php-config file, a sample would be
./configure --with-php-config=/usr/bin/php-config7.1
Hope this solves the problem.
I assume you run phpize before running ./configure. Instead you need to run phpize7.1 and then ./configure
if you don't have phpize7.1 installed you can install it via:
sudo apt install apt install php7.1-dev

OSX 10.10 Yosemite local development environment broke - PHP mcrypt Issue

I a running a local development environment on my MBP using osx yosemite, php 5.5.14, apache 2.4 mysql (sometimes) and a few things installed via brew.
I tried to run a CMS locally and ran into an issue where it stated i needed mcrypt; so i tried to install it and was promptly tole mcrypt was already installed.
Did a little research, tried to reinstall it and now I'm faced with this error when running php -v. Also this has stopped m dev enviroment from showing me my site and all it says now is 'it works!'
PHP Warning: PHP Startup: Unable to load dynamic library
'/usr/local/Cellar/php55-mcrypt/5.5.21/mcrypt.so' -
dlopen(/usr/local/Cellar/php55-mcrypt/5.5.21/mcrypt.so, 9): image not
found in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library
'/usr/local/Cellar/php55-mcrypt/5.5.21/mcrypt.so' -
dlopen(/usr/local/Cellar/php55-mcrypt/5.5.21/mcrypt.so, 9):
image not found in Unknown on line 0
PHP 5.5.21 (cli) (built: Feb 12 2015 20:17:17)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
Any help would be very appreciated and thanks in advance.
Make sure that you're loading the mcrypt.so extension in your php.ini file. Also, you may need to run brew install mcrypt php55-mcrypt to get the PHP extension.
Find the location of your ini with:
php -i | grep php.ini
Edit the file and add extension=mcrypt.so to the file, save and restart Apache.

MongoClient not found in PHP

I have downloaded php_mongo-1.3.2RC1.zip from https://github.com/mongodb/mongo-php-driver/downloads
Then I have extracted all of them in my C:\xampp\php\ext directory. To use mongodb though php file located in 'C:\xampp\htdocs\index.php' directory, I have added extension=php_mongo-1.3.2RC1-5.2-vc9.dll this line to C:\xampp\php\php.ini.
Yet I have got this error Fatal error: Class 'MongoClient' not found. What can I do to make it work?
I am using Xampp on windows 8 64 bit running on php 5.2.
I have tried writing php on cmd and it returns this following lines:
Warning: PHP Startup: mongo: Unable to initialize module
Module compiled with module API=20060613
PHP compiled with module API=20100525
These options need to match
in Unknown on line 0
I have tried phpinfo() as #j0k has asked, and it returned:
Configuration File (php.ini) Path C:\Windows
Loaded Configuration File C:\xampp\php\php.ini
Try this:
pear install -f pecl/mongo
I think you use php 5.4 (info from my web server):
$ php -v; phpize -v
PHP 5.4.11 (cli) (built: Feb 10 2013 03:38:26)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
Configuring for:
PHP Api Version: 20100412
Zend Module Api No: 20100525
Zend Extension Api No: 220100525
API module versions are identical.
…
Module compiled with module API=20060613
…
It is php 5.2 (from source code):
$ grep '#define ZEND_MODULE_API_NO' php-src-php-5.2.17/Zend/zend_modules.h| sed 's/#define ZEND_MODULE_API_NO//'
20060613
Check you version php (php -v; phpize -v) and setup php-mongo-driver. You can see versions in phpinfo(); (recommended; PHP API, PHP Extension, Zend Extension, Thread Safety)
Try to restart your Apache. Apache will not try to reload the configuration upon edit. For xampp you can do this in the cornor pressing shutdown or restart, if I Remember correctly. Alternative you can restart your pc
From this page:
Note: Additional DLL dependencies for Windows Users:
In order for this extension to work, there are DLL files that must be available to the Windows system PATH

PHP Apache ImageMagick extension won't load

I am runnning 64-bit Windows 7 with Apache 2.2, PHP 5.4.4 VC9. I have downloaded and installed ImageMagick 6.6.4 and successfully tested it from the command prompt. I have restarted my computer. I have tried many different extension files and keep getting the following error in my Apache logs.
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\PHP\\ext\\php_imagick_ts.dll' - The specified procedure could not be found.\r\n in Unknown on line 0
I have my extension_dir set to C:\PHP\ext. And I of course have added the line extension=php_imagick_ts.dll modified according to which file I am trying.
I have Imagick working on Win7 x64 with PHP 5.4 (only tested commandline, but Apache should work) using the beta libraries as compiled and hosted here: http://www.peewit.fr/imagick/
I installed ImageMagick via the ImageMagick-6.8.0-7-Q16-windows-dll.exe file on the ImageMagick downloads page.
C:\>php -v
PHP 5.4.0 (cli) (built: Feb 29 2012 19:24:02)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
C:\>php -m
[PHP Modules]
...
imagick
...
I haven't actually tested using this extension yet, but I'm fairly confident that this will work, given that all of the other .dlls I tried resulted in php.exe crashing when I tried simply running php -v!
The only thing that ended up working for me was to load php 5.3. Began working immediately.

Categories