Page 1 of 1

Getting performance info from Windows using w32api?

Posted: Wed Jul 06, 2005 8:43 pm
by jonrosen
Hi,

I am trying to use the w32api functions to access Windows performance data. I tried copying the example in the manual (which says it is removed to PECL as of 5.1 - I am on 5.0.4, and PECL has no sign of the library anyway).

Here is some example code (the code is appropriately wrapped in html):

Code: Select all

<?php
dl("php_w32api.dll");
w32api_function_definition("kernel32.dll", "GetTickCount", long);
$ticks = w32api_invoke_function("GetTickCount");
echo "You have been using your computer for ".$ticks." milliseconds."
?>
This results in the following error message:

Code: Select all

Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_w32api.dll in your php.ini in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 5

Fatal error: Call to undefined function w32api_function_definition() in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 6
Removing the first line in the program (the call to dl()) simply eliminates the Warning and leaves me with the Fatal error.

I tried putting the following line:

Code: Select all

extension=php_w32api.dll
[code]

in my php.ini file and that seemed to do nothing.

Any ideas?

Thanks!o sign of the library anyway).  

Here is some example code (the code is appropriately wrapped in html):

[php]<?php
dl("php_w32api.dll");
w32api_function_definition("kernel32.dll", "GetTickCount", long);
$ticks = w32api_invoke_function("GetTickCount");
echo "You have been using your computer for ".$ticks." milliseconds."
?>[/php]

This results in the following error message:

[code]
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_w32api.dll in your php.ini in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 5

Fatal error: Call to undefined function w32api_function_definition() in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 6
[/code]

Removing the first line in the program (the call to dl()) simply eliminates the Warning and leaves me with the Fatal error.  

I tried putting the following line:

[code]
extension=php_w32api.dll
[code]

in my php.ini file and that seemed to do nothing.

Any ideaspi.dll in your php.ini in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 5

Fatal error: Call to undefined function w32api_function_definition() in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 6
[/code]

Removing the first line in the program (the call to dl()) simply eliminates the Warning and leaves me with the Fatal error.  

I tried putting the following line:

[code]
extension=php_ndows performance data.  I tried copying the example in the manual (which says it is removed to PECL as of 5.1 - I am on 5.0.4, and PECL has no sign of the library anyway).  

Here is some example code (the code is appropriately wrapped in html):

[php]<?php
dl("php_w32api.dll");
w32api_function_definition("kernel32.dll", "GetTickCount", long);
$ticks = w32api_invoke_function("GetTickCount");
echo "You have been using your computer for ".$ticks." milliseconds."
?>[/php]

This results in the following error message:

[code]
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_w32api.dll in your php.ini in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 5

Fatalto PECL as of 5.1 - I am on 5.0.4, and PECL has no sign of the library anyway).  

Here is some example code (the code is appropriately wrapped in html):

[php]<?php
dl("php_w32api.dll");
w32api_function_definition("kernel32.dll", "GetTickCount", long);
$ticks = w32api_invoke_function("GetTickCount");
echo "You have been using your computer for ".$ticks." milliseconds."
?>[/php]

This results in the following error message:

[code]
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_w32api.dll in your php.ini in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 5

Fatal error: Call to undefined function w32api_function_definition() in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 6
[/code]

Removing the first line in the program (the call to dl()) simply eliminates the Warning and leaves me with the Fatal error.  

I trWindows performance data.  I tried copying the example in the manual (which says it is removed to PECL as of 5.1 - I am on 5.0.4, and PECL has no sign of the library anyway).  

Here is some example code (the code is appropriately wrapped in html):

[php]<?php
dl("php_w32api.dll");
w32api_function_definition("kernel32.dll", "GetTickCount", long);
$ticks = w32api_invoke_function("GetTickCount");
echo "You have been using your computer for ".$ticks." milliseconds."
?>[/php]

This results in the following error message:

[code]
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_w32api.dll in your php.ini in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 5

Fatal error: Call to undefined function w32api_function_definition() in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 6
[/code]

Removing the first line in the program (the call to dl()) simply eliminates the Warning and leaves me with the Fatal error.  

I tried putting the following line:

[code]
extension=php_w32api.dll
[code]

in my php.ini file and that seemed to do nothing.

Any ideas?

Thanks!" milliseconds."
?>[/php]

This results in the following error message:

[code]
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_w32api.dll in your php.ini in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 5

Fatal error: Call to undefined function w32api_function_definition() in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 6
[/code]

Removing the first line in the program (the call to dl()) simply eliminates the Warning and leaves me with the Fatal error.  

I tried putting the following line:

[code]
extension=php_w32api.dll
[code]

in my php.ini file and that seemed to do nothing.

Any ideas?

Thanks!uter for ".$ticks." milliseconds."
?>[/php]

This results in the following error message:

[code]
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_w32api.dll in your php.ini in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 5

Fatal error: Call to undefined function w32api_function_definition() in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 6
[/code]

Removing the first line in the program (the call to dl()) simply eliminates the Warning and leaves me with the Fatal error.  

I tried putting the following line:

[code]
extension=php_w32api.dll
[code]

in my php.ini file and that seemed to do nothing.

Any ideas?

Thanks!h says it is removed to PECL as of 5.1 - I am on 5.0.4, and PECL has no sign of the library anyway).  

Here is some example code (the code is appropriately wrapped in html):

[php]<?php
dl("php_w32api.dll");
w32api_function_definition("kernel32.dll", "GetTickCount", long);
$ticks = w32api_invoke_function("GetTickCount");
echo "You have been using your computer for ".$ticks." milliseconds."
?>[/php]

This results in the following error message:

[code]
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_w32api.dll in your php.ini in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 5

Fatal error: Call to undefined function w32api_function_definition() in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 6
[/code]

Removing the first line in the program (the call to dl()) simply eliminates the Warning and leaves me with the Fatal error.  

Is removed to PECL as of 5.1 - I am on 5.0.4, and PECL has no sign of the library anyway).  

Here is some example code (the code is appropriately wrapped in html):

[php]<?php
dl("php_w32api.dll");
w32api_function_definition("kernel32.dll", "GetTickCount", long);
$ticks = w32api_invoke_function("GetTickCount");
echo "You have been using your computer for ".$ticks." milliseconds."
?>[/php]

This results in the following error message:

[code]
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_w32api.dll in your php.ini in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 5

Fatal error: Call to undefined function w32api_function_definition() in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 6
[/code]

 to use the w32api functions to access Windows performance data.  I tried copying the example in the manual (which says it is removed to PECL as of 5.1 - I am on 5.0.4, and PECL has no sign of the library anyway).  

Here is some example code (the code is appropriately wrapped in html):

[php]<?php
dl("php_w32api.dll");
w32api_function_definition("kernel32.dll", "GetTickCount", long);
$ticks = w32api_invoke_function("GetTickCount");
echo "You have been using your computer for ".$ticks." milliseconds."
?>[/php]

This results in the following error message:

[code]
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_w32api.dll in your php.ini in C:\Pi functions to access Windows performance data.  I tried copying the example in the manual (which says it is removed to PECL as of 5.1 - I am on 5.0.4, and PECL has no sign of the library anyway).  

Here is some example code (the code is appropriately wrapped in html):

[php]<?php
dl("php_w32api.dll");
w32api_function_definition("kernel32.dll", "GetTickCount", long);
$ticks = w32api_invoke_function("GetTickCount");
echo "You have been using your computer for ".$ticks." milliseconds."
?>[/php]

This results in the following error message:

[code]
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_w32api.dll in your php.ini in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 5

Fatal error: Call to undefined function w32api_function_definition() in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 6
[/code]

Removing the first line in the program (the call to dl(le code (the code is appropriately wrapped in html):

[php]<?php
dl("php_w32api.dll");
w32api_function_definition("kernel32.dll", "GetTickCount", long);
$ticks = w32api_invoke_function("GetTickCount");
echo "You have been using your computer for ".$ticks." milliseconds."
?>[/php]

This results in the following error message:

[code]
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_w32api.dll in your php.ini in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 5

Fatal error: Call to undefined function w32api_function_definition() in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 6
[/code]

Removing the first y anyway).  

Here is some example code (the code is appropriately wrapped in html):

[php]<?php
dl("php_w32api.dll");
w32api_function_definition("kernel32.dll", "GetTickCount", long);
$ticks = w32api_invoke_function("GetTickCount");
echo "You have been using your computer for ".$ticks." milliseconds."
?>[/php]

This results in the following error message:

[code]
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_w32api.dll in your php.ini in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 5

Fatal error: ce data.  I tried copying the example in the manual (which says it is removed to PECL as of 5.1 - I am on 5.0.4, and PECL has no sign of the library anyway).  

Here is some example code (the code is appropriately wrapped in html):

[php]<?php
dl("php_w32api.dll");
w32api_function_definition("kernel32.dll", "GetTickCount", long);
$ticks = w32api_invoke_function("GetTickCount");
echo "You have been using your computer for ".$ticks." milliseconds."
?>[/php]

This results in the following error message:

[code]
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_w32api.dll in your php.ini in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 5

Fatal error: Call to undefined function w32api_function_definition() in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 6
[/code]

Removing the first line in the program (the call to dl()) simply eliminates the Warning and leaves me with the Fatal error.  

I tried putting the following line:

[code]
extension=php_w32api.dll
[code]

in my php.ini file and that seemed to do nothing.

Any ideas?

Thanks!he code is appropriately wrapped in html):

[php]<?php
dl("php_w32api.dll");
w32api_function_definition("kernel32.dll", "GetTickCount", long);
$ticks = w32api_invoke_function("GetTickCount");
echo "You have been using your computer for ".$ticks." milliseconds."
?>[/php]

This results in the following error message:

[code]
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_w32api.dll in your php.ini in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 5

Fatal error: Call to undefined  example in the manual (which says it is removed to PECL as of 5.1 - I am on 5.0.4, and PECL has no sign of the library anyway).  

Here is some example code (the code is appropriately wrapped in html):

[php]<?php
dl("php_w32api.dll");
w32api_function_definition("kernel32.dll", "GetTickCount", long);
$ticks = w32api_invoke_function("GetTickCount");
echo "You have been using your computer for ".$ticks." milliseconds."
?>[/php]

This results in the following error message:

[code]
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_w32api.dll in your php.ini in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 5

Fatal error: Call to undefined function w32api_function_definition() in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 6
[/code]

Removing the first line in the program (the call to dl()) simply to use the w32api functions to access Windows performance data.  I tried copying the example in the manual (which says it is removed to PECL as of 5.1 - I am on 5.0.4, and PECL has no sign of the library anyway).  

Here is some example code (the code is appropriately wrapped in html):

[php]<?php
dl("php_w32api.dll");
w32api_function_definition("kernel32.dll", "GetTickCount", long);
$ticks = w32api_invoke_function("GetTickCount");
echo "You have been using your computer for ".$ticks." milliseconds."
?>[/php]

This results in the following error message:

[code]
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_w32api.dll in your php.ini in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 5

Fatal error: Call to undefined function w32api_function_definition() in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 6
[/code]

Removing the first line in the program (the call to dl()) simply eliminates the Warning and leaves me with the Fatal error.  

I tried putting the following line:

[code]
extension=php_w32api.dll
[code]

in my php.ini file and that seemed to do nothing.

Any ideas?

Thanks!ctions to access Windows performance data.  I tried copying the example in the manual (which says it is removed to PECL as of 5.1 - I am on 5.0.4, and PECL has no sign of the library anyway).  

Here is some example code (the code is appropriately wrapped in html):

[php]<?php
dl("php_w32api.dll");
w32api_function_definition("kernel32.dll", "GetTickCount", long);
$ticks = w32api_invoke_function("GetTickCount");
echo "You have been using your computer for ".$ticks." milliseconds."
?>[/php]

This results in the following error message:

[code]
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_w32api.dll in your php.ini in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.phlibrary anyway).  

Here is some example code (the code is appropriately wrapped in html):

[php]<?php
dl("php_w32api.dll");
w32api_function_definition("kernel32.dll", "GetTickCount", long);
$ticks = w32api_invoke_function("GetTickCount");
echo "You have been using your computer for ".$ticks." milliseconds."
?>[/php]

This results in the following error message:

[code]
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_w32api.dll in your php.ini in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 5

Fatal error: Call to undefined function  to access Windows performance data.  I tried copying the example in the manual (which says it is removed to PECL as of 5.1 - I am on 5.0.4, and PECL has no sign of the library anyway).  

Here is some example code (the code is appropriately wrapped in html):

[php]<?php
dl("php_w32api.dll");
w32api_function_definition("kernel32.dll", "GetTickCount", long);
$ticks = w32api_invoke_function("GetTickCount");
echo "You have been using your computer for ".$ticks." milliseconds."
?>[/php]

This results in the following error message:

[code]
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_w32api.dll in your php.ini in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 5

Fatal error: Call to undefined function w32api_function_definition() in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 6
[/code]

Removing the first line in the program (the call to dl()) simply eliminates the Warning and leaves me with the Fatal error.  

I tried putting the following line:

[code]
extension=php_w32api.dll
[code]

in my php.inmp;lt;?php
dl("php_w32api.dll");
w32api_function_definition("kernel32.dll", "GetTickCount", long);
$ticks = w32api_invoke_function("GetTickCount");
echo "You have been using your computer for ".$ticks." milliseconds."
?>[/php]

This results in the following error message:

[code]
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_w32api.dll in your php.ini in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 5

Fatal error: Call to undefined function w32api_function_definition() in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 6
[/code]

Removing the first line in the program (the call to dl()) simply eliminates the Warning and leaves me with the Fatal error.  

I tried putting the following line:

[code]
extension=php_w32api.dll
[code]

in my php.ini file and that seemed to do nothing.

Any ideas?

Thanks!rformance data.  I tried copying the example in the manual (which says it is removed to PECL as of 5.1 - I am on 5.0.4, and PECL has no sign of the library anyway).  

Here is some example code (the code is appropriately wrapped in html):

[php]<?php
dl("php_w32api.dll");
w32api_function_definition("kernel32.dll", "GetTickCount", long);
$ticks = w32api_invoke_function("GetTickCount");
echo "You have been using your computer for ".$ticks." milliseconds."
?>[/php]

This results in the following error message:

[code]
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_w32api.dll in your php.ini in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 5

Fatal error: Call to undefined function w32api_function_definition() in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 6
[/code]

Removing the first line in the program (the call to dl()) s(which says it is removed to PECL as of 5.1 - I am on 5.0.4, and PECL has no sign of the library anyway).  

Here is some example code (the code is appropriately wrapped in html):

[php]<?php
dl("php_w32api.dll");
w32api_function_definition("kernel32.dll", "GetTickCount", long);
$ticks = w32api_invoke_function("GetTickCount");
echo "You have been using your computer for ".$ticks." milliseconds."
?>[/php]

This results in the following error message:

[code]
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_w32api.dll in your php.ini in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 5

Fatal error: Call to undefined function w32api_function_definition() in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 6
[/code]

Removing the first line in the program (the call to dl()) simply eliminates the Warning and leaves me with the Fatal error.  

I tried putting the following line:

[code]
extension=php_w32api.dll
[code]

in my php.ini file and that seemed to do nothing.

Any ideas?

Thanks! to use the w32api functions to access Windows performance data.  I tried copying the example in the manual (which says it is removed to PECL as of 5.1 - I am on 5.0.4, and PECL has no sign of the library anyway).  

Here is some example code (the code is appropriately wrapped in html):

[php]<?php
dl("php_w32api.dll");
w32api_function_definition("kernel32.dll", "GetTickCount", long);
$ticks = w32api_invoke_function("GetTickCount");
echo "You have been using your computer for ".$ticks." milliseconds."
?>[/php]

This results in the following error message:

[code]
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_w32api.dll in your php.ini in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 5

Fatal error: Call to undefined function w32api_function_definition() in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 6
[/code]

Removing the first line in the program (the call to dl()) simply eliminates the Warning and leaves me with the Fatal error.  

I tried putting the following line:

[code]
extension=php_w32api.dll
[code]

in my php.ini file and that seem the example in the manual (which says it is removed to PECL as of 5.1 - I am on 5.0.4, and PECL has no sign of the library anyway).  

Here is some example code (the code is appropriately wrapped in html):

[php]<?php
dl("php_w32api.dll");
w32api_function_definition("kernel32.dll", "GetTickCount", long);
$ticks = w32api_invoke_function("GetTickCount");
echo "You have been using your computer for ".$ticks." milliseconds."
?>[/php]

This results in the following error message:

[code]
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_w32api.dll in your php.ini in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 5

Fatal error: Call to undefined function w32api_function_definition() in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 6
[/code]

Removing the firstmple in the manual (which says it is removed to PECL as of 5.1 - I am on 5.0.4, and PECL has no sign of the library anyway).  

Here is some example code (the code is appropriately wrapped in html):

[php]<?php
dl("php_w32api.dll");
w32api_function_definition("kernel32.dll", "GetTickCount", long);
$ticks = w32api_invoke_function("GetTickCount");
echo "You have been using your computer for ".$ticks." milliseconds."
?>[/php]

This results in the following error message:

[code]
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_w32api.dll in your php.ini in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 5

Fatal error: Call to undefined function w32api_function_definition() in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 6
[/code]

Removing the first line in the program (the call to dl()) simply manual (which says it is removed to PECL as of 5.1 - I am on 5.0.4, and PECL has no sign of the library anyway).  

Here is some example code (the code is appropriately wrapped in html):

[php]<?php
dl("php_w32api.dll");
w32api_function_definition("kernel32.dll", "GetTickCount", long);
$ticks = w32api_invoke_function("GetTickCount");
echo "You have been using your computer for ".$ticks." milliseconds."
?>[/php]

This results in the following error message:

[code]
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_w32api.dll in your php.ini in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 5

Fatal error: Call to undefined function w32api_function_definition() in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 6
[/code]

Removing the first line in the program (the call to dl()) simply elimi to use the w32api functions to access Windows performance data.  I tried copying the example in the manual (which says it is removed to PECL as of 5.1 - I am on 5.0.4, and PECL has no sign of the library anyway).  

Here is some example code (the code is appropriately wrapped in html):

[php]<?php
dl("php_w32api.dll");
w32api_function_definition("kernel32.dll", "GetTickCount", long);
$ticks = w32api_invoke_function("GetTickCount");
echo "You have been using your computer for ".$ticks." milliseconds."
?>[/php]

This results in the following error message:

[code]
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_w32api.dll in your php.ini in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 5

Fatal error: Call to undefined function w32api_function_definition() in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 6
[/code]

Removing the first line in the program (the call to dl()) simply eliminates the Warning and leaves me with the Fatal error.  

I tried putting the following line:

[code]
extension=php_w32api.dll
[code]

in my php.ini file and that seemed to do nothing.

Any ideas?

Thanks!e data.  I tried copying the example in the manual (which says it is removed to PECL as of 5.1 - I am on 5.0.4, and PECL has no sign of the library anyway).  

Here is some example code (the code is appropriately wrapped in html):

[php]<?php
dl("php_w32api.dll");
w32api_function_definition("kernel32.dll", "GetTickCount", long);
$ticks = w32api_invoke_function("GetTickCount");
echo "You have been using your computer for ".$ticks." milliseconds."
?>[/php]

This results in the following error message:

[code]
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_w32api.dll in your php.ini in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 5

Fatal error: Call to undefined function w32api_function_definition() in C: to use the w32api functions to access Windows performance data.  I tried copying the example in the manual (which says it is removed to PECL as of 5.1 - I am on 5.0.4, and PECL has no sign of the library anyway).  

Here is some example code (the code is appropriately wrapped in html):

[php]<?php
dl("php_w32api.dll");
w32api_function_definition("kernel32.dll", "GetTickCount", long);
$ticks = w32api_invoke_function("GetTickCount");
echo "You have been using your computer for ".$ticks." milliseconds."
?>[/php]

This results in the following error message:

[code]
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_w32api.dll in your php.ini in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 5

Fatal error: Call to undefined function w32api_function_definition() in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 6
[/code]

Removing the first line in the program (the call to dl()) simply elicopying the example in the manual (which says it is removed to PECL as of 5.1 - I am on 5.0.4, and PECL has no sign of the library anyway).  

Here is some example code (the code is appropriately wrapped in html):

[php]<?php
dl("php_w32api.dll");
w32api_function_definition("kernel32.dll", "GetTickCount", long);
$ticks = w32api_invoke_function("GetTickCount");
echo "You have been using your computer for ".$ticks." milliseconds."
?>[/php]

This results in the following error message:

[code]
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_w32api.dll in your php.ini in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 5

Fatal error: Call to undefined function w32api_function_definition() in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 6
[/code]

Removing the first line in the progrto access Windows performance data.  I tried copying the example in the manual (which says it is removed to PECL as of 5.1 - I am on 5.0.4, and PECL has no sign of the library anyway).  

Here is some example code (the code is appropriately wrapped in html):

[php]<?php
dl("php_w32api.dll");
w32api_function_definition("kernel32.dll", "GetTickCount", long);
$ticks = w32api_invoke_function("GetTickCount");
echo "You have been using your computer for ".$ticks." milliseconds."
?>[/php]

This results in the following error message:

[code]
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_w32api.dll in your php.ini in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 5

Fatal error: Call to undefined function w32api_function_definition() in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 6
[/code]

Removing the first line in the program (the call to dl()) simply eliminates the Warning and leaves me with the Fatal error.  

I tried putting the following line:

[code]
extension=php_w32api.dll
[code]

in my php.ini file and that seemed to do nothing.

Any ideas?

Thanks!", "GetTickCount", long);
$ticks = w32api_invoke_function("GetTickCount");
echo "You have been using your computer for ".$ticks." milliseconds."
?>[/php]

This results in the following error message:

[code]
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_w32api.dll in your php.ini in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 5

Fatal error: Call to undefined function w32api_function_definition() in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 6
[/code]

Removing the first line in the program (the call to dl()) simply eliminates the Warning and leaves me with the Fatal error.  

I tried putting the following line:

[code]
extension=php_w32api.dll
[code]

in my php.ini file and that seemed to do nothing.

Any ideas?

Thanks!<?php
dl("php_w32api.dll");
w32api_function_definition("kernel32.dll", "GetTickCount", long);
$ticks = w32api_invoke_function("GetTickCount");
echo "You have been using your computer for ".$ticks." milliseconds."
?>[/php]

This results in the following error message:

[code]
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_w32api.dll in your php.ini in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 5

Fatal error: Call to undefined function w32api_function_definition() in C:\Program Files\xampp\xampp\htdocs\coral8\testwin32api.php on line 6
Removing the first line in the program (the call to dl()) simply eliminates the Warning and leaves me with the Fatal error.

I tried putting the following line:

Code: Select all

extension=php_w32api.dll

Code: Select all

in my php.ini file and that seemed to do nothing.

Any ideas?

Thanks!

Posted: Thu Jul 07, 2005 8:40 am
by hairyjim
You are getting the fatal error because the php_w32api.dll is not being loaded by php.

In your php.ini file there should be a line like this: ;extension=php_w32api.dll

Remove the smi-colon at the front.

Now also look for the following line in the ini file:
extension_dir =

I am not sure what you may have set. Mine is:
extension_dir = "c:/php/extensions/"

Take note of this folder path and navigate to the folder. Make sure the file php_w32api.dll is in that folder.

you can always check if the file is loaded by running the phpinfo function in a script.

Code: Select all

<?php phpinfo(); ?>
Jim