PHP extension stats - php

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.

Related

PHP Warning: PHP Startup: Unable to load dynamic library '- The specified procedure could not be found. in Unknown on line 0

I would like to change php version to 7.1 and i have an error:
PHP Warning: PHP Startup: Unable to load dynamic library
'C:\Program Files\PHP\v7.1\ext\php_sqlsrv_7_nts_x86.dll' - The specified procedure could not be found.
in Unknown on line 0
First think. This is not duplicate question because i checked many similar questions.
I'm using IIS, PHP 7.1, and SQL server (thats why i need sqlsrv drivers).
I checked php.ini file aready and i change extension-dir path to full path but nothing happens. (Logically if path is a problem why it works with other extensions? ).
It works with PHP 7.0.7 (all enabled extensions is exactly same)
Update: still won't work but i tried to paste path from error message to file explorer and file already there.
Turns out that PHP 7.0 and PHP 7.1 are not compatible and the mssql PDO drivers are for 7.0.
Github issue here
Also ensure you including the right 64/86 and ts/nts version.
As from Toby Allen's accepted answer above 7.0 and 7.1 are incompatible,
However Microsoft has released Preview versions of the drivers for 7.1.
This worked for me, hope it helps anyone searching.
Drivers can be found here under downloads
I had this issue yesterday. The key to the error is the last bit.
The specified procedure could not be found.
In my case I went through a painful amount of debugging. The first thing that I noticed was that when I ran a hello world php file, I didn't get this error. That indicated to me it wasn't actually a problem loading the file, it was a problem calling a function in the file.
I went in and repeatedly put die() statements in and moved it until it hit the error. It took awhile but I eventually discovered I was calling sqlsrv_connect with options that were (apparently) now invalid.
So I can't say the exact cause of your issue without seeing the code that actually causes the error, but I hope this at least points you in the right direction.

Call to undefined function curl_init() in codeiginter

I am receiving this error when I try to access my newsletter plugin, I have uncomment the curl extension in both php\php.ini and apache\php.ini, and also in configuration file of php. Even I restarted my server after changes but still I am getting error. How can I solve this issue ??
I have tried these extensions (extesnions link here) according to my php version and it worked!
Cheers
Start the Curl extension of PHP directly by changing PHP.ini file or by clicking wamp and then scroll to PHP->extensions

Call to undefined function mb_detect_encoding() in Xampp after changing PHP version (PHPmyadmin)

I changed the default PHP version to an older one (5.3.28) but when I try to jump in to PHPMyadmin I get the error
*Fatal error: Call to undefined function mb_detect_encoding() in C:\xampp2\phpMyAdmin\libraries\php-gettext\gettext.inc on line 177*
Browsing trough this forum I found that this means I need the mbstring library
I enabled it in php.ini like this:
extension=php_mbstring.dll
But I keep receiving the same error.
I checked the extensions directory
extension_dir="C:\xampp2\php5328\ext"
and its correct, and the extension file is there as well (php_mbstring.dll)
But when I load phpinfo() I cant find any mention of mbstring.
Any ideas?
Got it solved #.# I was clicking config in XAMP and I thought it would for some reason open automatically the old php file (even tho Xampp is already configured to use the new one)
So yeah X) I was modifying the wrong php.ini
Thanks!

enable curl in xampp, windows

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');

"The specified procedure could not be found" IIS 6.0 and PHP5

I am trying to make PHP5 work over IIS 6.0 on Windows server 2003 and i am following this steps:
http://www.iisadmin.co.uk/?p=4
The thing is, there's no file named "php5isapi.dll" inside the php folder, so I am using php5isapi.dll instead. Is it correct? Or should I try to download the php5isapi.dll from somewhere.
Well, then, I keep following the steps and when I try to execute my php file, I get this message:
The specified procedure could not be found.
What am I doing wrong?
Thanks.
UPDATE
I downloaded php5isapi.dll and tried to make it work with it but i am getting this error:
The specified module could not be found.
Also, after any change, i restart the Default Web Site clicking on stop and play.
UPDATE 2
Now, after rebooting, when trying to access the PHP file, the browser shows a 500 error:
The page cannot be displayed
I noticed that "php5isapi.ll" is no longer available for the last versions of PHP as pointed in here:
Why is php5isapi.dll missing after installing PHP for Windows?
Therefor, what i did was following this tutorial in order to do it with FastCGI
http://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/using-fastcgi-to-host-php-applications-on-iis-60
I found it on this comment:
Why is php5isapi.dll missing after installing PHP for Windows?
After restarting the server, it finally worked.

Categories