I am using Linux server. When I am trying to run exif_read_data() I am getting Fatal error: Call to undefined function exif_read_data() .
Then I contacted the server provider and they say that EXIF extension is enabled in my server. but I am getting the same error.
I have performed the Graceful Server Reboot several time
I have tried to run
if (function_exists('exif_read_data'))
and it is returning false. Also I have include phpinfo() in my page and nothing related to exif is listed in Configure Command portion.
But why did they say it is enabled for my site. Any other possibilities???
While looking phpinfo(); output finds a section like this.
exif exttension esction detail
Related
I'm using PHP in combination with Xampp and have installed the extension stats for Windows (https://pecl.php.net/package/stats/2.0.3/windows). Phpinfo says everything works fine. Stats is enabled. Nevertheless I am getting the error message
Uncaught Error: Call to undefined function stats_rand_gen_ibinomial(),
when I am using the function stats_rand_gen_ibinomial, which is documented here https://www.php.net/manual/en/function.stats-rand-gen-ibinomial.php.
Have you got experiences with these extension?
In php.ini i have added the following line: extension=stats
My first thought was that you need to restart the apache but the output in the screen seems to be be ok, then I executed ">php -m" and the extension was listed but when I run a script calling stats_rand_gen_ibinomial() it fails(exactly what you describe).
I download the source code 2.0.3 and 2.0.0 and the method is not included!!, the same with 1.0.5 and 1.0.4. The last version when the method does exist is : 1.0.3.
You can download all the versions here https://pecl.php.net/package/stats and look for the last one with that method definition. But the conclusion is that for some reason that method is not included . I ignore the reason.
i am using MAMP server i am trying load a extension in my php but i am getting error, i tried everything but i cant make it load :(.
i am using mac os and php 5.6.7
that line is for the extension: extension=protocolbuffers.so
i inserted in: Applications/MAMP/bin/php/php5.6.7/conf/php.ini
i inserted too in: /Applications/MAMP/conf/php5.6.7/php.ini
and still not loading.
i run that php file called: extension.php to see if my extension is loading.
so i got the error so i definitely not loading the extension:
Fatal error: Call to undefined function dl() in /Applications/MAMP/htdocs/ci-match/extension.php on line 3
<?php
if (!extension_loaded('protocolbuffers')) {
if (!dl('protocolbuffers.so')) {
exit;
}
}
?>
i use too php
print_r(get_loaded_extensions());
?>
but i cant see my extension there, how can u guys help me to load that extension?
can you guys help me with that? thank you.
Besides the fact that the dl()-function has been removed completely from a number of SAPIs, it usually is disabled for security reasons.
I'm not sure whether the disable will result in an undefined function error or in a security error of some kind. Guess you'll have to find out.
You can control access to it using the enable_dl-directive in php.ini and by making sure safe mode is not enabled.
As for your attempts to load the extension:
I WOULD run a .php file with phpinfo(); in. That will tell you which .ini files are being loaded and where the extension directory is.
You can then use that information to add it in the correct location. Chances are that your MAMP loads from a weird location.
It's very hard to diagnose issues like that remotely.
I have read numerous posts regarding enabling sockets on WAMP.
I have uncommented the extensions from both php.ini files that exist, and also checked that it is indeed enabled by left clicking wamp icon > PHP > PHP Extensions and making sure that php_sockets is checked ( and it is ).
Also if I view load phpinfo in my browser I see that web sockets is enabled.
However, when I try to execute a script from the command line, I get the following error:
PHP Fatal error: Call to undefined function socket_create() in /cygdrive/c/wamp/www/chat/websockets.php on line 20
Also, I read somewhere that I should see web sockets in the list if I do the following in the command line: php -me, however when I do that I DO NOT see sockets in the list, I guess this might be the problem but don't know what to do about it, since I have enabled everything I found.
I'm using exif data to carry captions for my images.
Using exif_read_data on localhost worked fine (with Apache on Ubuntu), but Heroku reports:
PHP Fatal error: Call to undefined function exif_read_data() in /app/path/to/files.
I'm not really sure what to do here, looking at the error message it would appear that EXIF functions are not installed/enabled on my Heroku app.
Can it be added or enabled?
You are correct that the EXIF functions are not enabled on your Heroku app.
Since the "new" PHP buildpack, all that is needed to enable extension is to define the required extensions in the composer.json file.
In the case of the EXIF that would be:
{
"require": {
"ext-exif":"*"
}
}
This is covered in the Heroku devcenter in the article for custom PHP settings.
exif extension is not enabled in your heroku environment.
You need support for exif in order to use its functions. In php.ini you will find these two lines are the ones that do it:
extension=php_mbstring.dll
extension=php_exif.dll
And of course the dlls should be available in the correct folder - For linux instead of .dll they would be .so. I am not sure how it works in heroku. Maybe you can get their tech support to check these?
trying to enable curl in xampp 3.0.12 in windows environment.
Updated the php.ini in the php folder to enable curl, and there is no php.ini file in the apache/bin folder.
phpinfo() says:
loaded configuration file: C:\xampp\php\php.ini
curl support:enbaled
curl information: 7.24.0
and when i try to run a http_get() command php says:
Fatal error: Call to undefined function http_get()
Restarted both windows and xampp several times to update the changes.
Would be grateful for some advice, as I searched through similar topics on the web but can't get any further.
Note that the function http_get() belongs to the pecl http extension and not to the curl extension. Refer to the documentation of the curl extension to learn how you can use it to retrieve documents via http. You'll also find a lot of posts on stackoverflow
Also note, that the function file_get_contents() can be used to get documents over http in a very simple way. Although it is limited it will fit in much cases. To retrieve a page you can issue:
file_get_contents('http://www.server.com/page.html');