473,791 Members | 3,137 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

extension_loade d() causes Apache to lock up tight!

[PHP]
if (!function_exis ts('memory_get_ usage')) {
/**
* Determine the amount of memory you are allowed to have
*
* @access public
* @return long
* @see actual_path
* @link http://us2.php.net/manual/en/functio...sage.php#64156
How to use memory_get_usag e() function in this

context
* @link

http://groups.google.com/group/comp....35b76328c2bab1

Upgrade to client status of memory_get_usag e() for use within Windows
XP Home
*/
function memory_get_usag e() {
print_r(extensi on_loaded('win3 2ps')); die('');
global $clientFolderPa th;
$outputArray = array();
if (($_SERVER['windir'] || $_ENV['windir']) &&
@extension_load ed('win32ps')) {
return win32_ps_stat_p roc(getmypid()) ;
} elseif (($_SERVER['windir'] || $_ENV['windir']) &&
@is_dir(actual_ path(realpath(" $clientFolderPa th/win"))) &&
@is_file(actual _path(realpath( "$clientFolderP ath/win/
pslist.exe")))
) {
exec('"' . actual_path($cl ientFolderPath) . '/win/pslist" -m ' .
getmypid(), $outputArray, $rc);
print_r($output Array);
return trim(substr($ou tputArray[8], 38, 10));
} elseif ($_SERVER['windir'] || $_ENV['windir']) {
exec('tasklist /FI "PID eq ' . getmypid() . '" /FO LIST',
$outputArray);
return preg_replace( '/[\D]/', '', $outputArray[5] ) * 1024;
} else {
exec('ps -o rss -p ' . getmypid(), $outputArray);
return $outputArray[1] * 1024;
}
}
}
[/PHP]

Environment: Win XP, Wamp5 (Apache 2.0.53, PHP 5.2.0)

As it stands, win32ps.dll is not loaded, thus,
extension_loade d('win32ps') should return false:

Array
(
[0] =bcmath
[1] =calendar
[2] =com_dotnet
[3] =ctype
[4] =session
[5] =filter
[6] =ftp
[7] =hash
[8] =iconv
[9] =json
[10] =odbc
[11] =pcre
[12] =Reflection
[13] =date
[14] =libxml
[15] =standard
[16] =tokenizer
[17] =zlib
[18] =SimpleXML
[19] =dom
[20] =SPL
[21] =wddx
[22] =xml
[23] =xmlreader
[24] =xmlwriter
[25] =apache2handler
[26] =mbstring
[27] =gd
[28] =mysql
[29] =mysqli
[30] =PDO
[31] =pdo_sqlite
[32] =SQLite
)
But instead Apache locks up into an infinite loop, producing no Apache
errors, no PHP errors, no output, nothing, just sits there trying to
load the phge without ever timing out or even producing 100% CPU
memory loss!

Have you ever seen this before with extension_loade d(), a bug or what
is really going on?

Thanx
Phil

Feb 18 '07 #1
0 1426

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
5378
by: Peter Gaunt | last post by:
I'm in the process of moving my site from one server to another (my old hosting company appears to have gone bust). On the old host and on my local Mac OS X machine I can send HTTP/1.1 response headers with no problem (e.g. header( 'HTTP/1.1 200 OK' ). If I do the same on the new server I get redirected to the server's 'Internal Error' page (i.e. error 500). No indication of what the error is.
1
2809
by: M Wells | last post by:
Hi All, I'm trying to implement encryption to protect data in my database. I started by experimenting with the following code, just to make sure I know how to encrypt and then decrypt but for some reaqson when I add the line "$plaintext = mcrypt_decrypt(..." etc Apache crashes. I'm using: - PHP 4.3.2
8
6814
by: Roy Padgett | last post by:
I have a combo box where users select the customer name and can either go to the customer's info or open a list of the customer's orders. The RowSource for the combo box was a simple pass-through query: SELECT DISTINCT , , ,City, Region FROM Customers ORDER BY Customers.; This was working fine until a couple of weeks ago. Now whenever someone has the form open, this statement locks the entire Customers table.
4
3193
by: Vincent | last post by:
Hello, Does anyone have a problem with Apache2 crashing after executing a PHP script with session_start()? I notice if session_start() is placed anywhere except at the start of the file, APache will crash. Can anyone explain to me why? I don't want session_start to be at the start of the file because I need to override some session methods. So session_start has to happen after the declaration of custom session methods. Can anyone...
8
3356
by: Joe Weinstein | last post by:
Hi. create table joe(c1 integer not null, c2 integer not null) Two sessions: Session 1: BEGIN TRAN insert into joe (c1,c2) values (1,2)
6
3415
by: DFS | last post by:
One of my systems grew exponentially - from 13mb to 43mb - after adding some 10 temp tables (with no data), a new form, and about a thousand lines of code. The .mdb has mostly table links, lots of forms and queries, and a good bit of code overall. But 43mb is totally unreasonble. I can't figure out where the problem is occurring. It was fine for a long time. I even created a new file and imported the objects and it blew back up to...
4
6971
by: liyanage | last post by:
I recently worked on error handling and three related issues/questions came up. 1.) I am trying to trigger Apache ErrorDocument handlers by setting appropriate HTTP status codes in my PHP code, but I don't get the expected results. My PHP file:
0
6857
by: phil469 | last post by:
I'm having an issue when trying to read a file in a user's homedir from a cgi script. I have a virtual host section in my httpd.conf file which I'll include. The cgi script is a very basic script written in Perl just for testing. I believe I need to find the correct <Directory> entry or some other Directive in Apache to make this work, but I've had no luck for a week now. I've tried many different things, but w/ no luck. I even tried adding...
1
1844
by: zbrozlo | last post by:
Hi, I have strange problem with my perl program. My program consists of two parts, first written in python and second in perl. Perl part is a server, but also uses two sockets for "talking" with gui written in python. Problem is, that from totally unknown reason perl program quits at line, where i'm trying to 'print' anything for AWAY gui socket. Here's part of my code : #!/usr/bin/perl use strict; use warnings; use IO::Socket; use...
0
9515
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10427
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10207
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9995
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5431
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5559
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4110
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2916
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.