PHP + Apache unter WinXP Pro ... gleichzeitige Requests
Dr.Colossos
- webserver
0 Mario0 lol0 Dr.Colossos0 lol
0 Felix Riesterer
Hi,
ich habe PHP 5.2.5 unter Windows XP Pro mit Apache 2.2.6 laufen.
Wenn ich das (höchst aufregende) Skript (siehe unten, z.B. script.php) im Web-Browser starte, und das selbe Skript in einem 2. (Firefox) Tab starte, dann krieg ich nur im 1. Tab output, der 2. "beginnt" dann erst zu schreiben wenn der 1. Tab beendet ist.
Nenn ich eine der Dateien um, z.B. script1.php, und script2.php, dann kann ich die beiden parallel asuführen - drei gehen wiederum nicht.
Starte ich script.php in Firefox, Opera und IE, dann werden alle drei gleichzeitig ausgeführt.
Unter Linux mit Apache + mod_php geht das übrigens problemlos was ich erreichen will ... das is ein script das ein socket öffnet (socket server), und mehrere clients die mit diesem socket server kommunizieren ... leider geht es aber unter Windows nur den socket server laufen zu lassen und einen client ... der zweite client läuft erst an wenn der erste client beendet wurde (alle drei in Firefox Tabs) - unter Linux wie gesagt geht es, und der server erhält requests von client 1 und 2 parallel.
Weiß wer warum das in meinem Windows Szenario nicht geht?
Danke sehr!
<?php
echo '<br>START: '.microtime(TRUE);
while($cnt++ < 29)
{
echo '<br>'.$cnt;
sleep(1);
}
echo '<br>END: '.microtime(TRUE);
?>
Hi,
sleep(1);
ich kann nur vermuten, früher ging sleep() gar nicht unter Windows, wie die das jetzt bei PHP geändert haben wiess ich nicht, aber ich vermute nocht sauber genug.
Mario
Windows Server ...... loooooooool
sowas dummes
Windows Server ...... loooooooool
sowas dummes
Geht's noch konstruktiver? Ich werde sicher keinen produktiven Windows-Server aufsetzen, es würde mich halt nur interessieren an was es liegt ... es gibt nämlich durch aus Firmen die einen Windows-Server einsetzen ... also bitte keinen "kiddy-windows-versus-linux-flame-war" anzetteln, das is ned mein Niveau - deins hoffentlich auch ned - Das Thema "Server" hab ich deswegen ausgewählt, weil ich nicht weiß ob Apache, PHP oder Windows, bzw. eine Kombination derer dafür verantwortlich ist.
@Mario: Danke für den Hinweis - aber ich glaube nicht, dass das der Grund ist. Starte ich nämlich den Server in FF, einen Client in Opera und einen Client in IE, dann rennt es, d.h. die server.php kriegt verschränkte Anfragen von client 1 und client 2 - sieht mir eher so an als würde jeder Browser max. zwei Handles öffnen können ...
Es ist eher meine Neugier die ich hier stillen möchte, denn der Server wird sicher nicht per Browser-Tab gestartet ...
Danke sehr
»» Windows Server ...... loooooooool
»»
»» sowas dummesGeht's noch konstruktiver? Ich werde sicher keinen produktiven Windows-Server aufsetzen, es würde mich halt nur interessieren an was es liegt ... es gibt nämlich durch aus Firmen die einen Windows-Server einsetzen ... also bitte keinen "kiddy-windows-versus-linux-flame-war" anzetteln, das is ned mein Niveau - deins hoffentlich auch ned - Das Thema "Server" hab ich deswegen ausgewählt, weil ich nicht weiß ob Apache, PHP oder Windows, bzw. eine Kombination derer dafür verantwortlich ist.
Lol... ok
Ne ich hab kollegen die in Firmen mit Windows Server arbeiten, die kommen auch immer mit solche Fehlern daher... nja und meine Antwort ist immer das was ich auch dir Antwortete
Ich glaub das es an Windows selbst liegt, Apache ist sonst Stabil und schrenkt ja eigentlich auch nicht ein, und etwas Nicht verarbeiten zu können klingt doch sehr nach windows!...
Service Pak dinger vorhanden? alle 3?
Pro version gecrackt? (und was das für einen unterschied macht!)
Lizenzen Aktuell?
l.g.
Hi,
Lol... ok
Ne ich hab kollegen die in Firmen mit Windows Server arbeiten, die kommen auch immer mit solche Fehlern daher... nja und meine Antwort ist immer das was ich auch dir Antwortete
Na bitte, ist so eine Antwort nicht gleich viel befriedigender, auch für dich?
Ich glaub das es an Windows selbst liegt, Apache ist sonst Stabil und schrenkt ja eigentlich auch nicht ein, und etwas Nicht verarbeiten zu können klingt doch sehr nach windows!...
Tja, "an Windows selbst" is so eine Sache. Das stimmt meines Erachtens schon AUCH - ich meine mich zu erinnern, dass Apache unter Windows nicht 100% rennt .. schon gut, aber halt auch etwas eingeschränkt, weil es halt ein port auf Windows ist ... das rührt aber aus meiner vagen Erinnerung heraus ...
Service Pak dinger vorhanden? alle 3?
Pro version gecrackt? (und was das für einen unterschied macht!)
Lizenzen Aktuell?
Jaja, alles original und lizenziert. Es ist kein Windows Server, es is XP Pro mit einem Apache, ned mehr ... is ja nur Entwicklugnsumgebung ...
Ich denke es is so dass der Apache unter Windows (evtl. mit/wegen meiner Konfiguration!) jedem Prozess nur zwei handles gewährt ...
Danke jedenfalls für diese Antwort!
Hallo,
ich meine mich zu erinnern, dass Apache unter Windows nicht 100% rennt .. schon gut, aber halt auch etwas eingeschränkt, weil es halt ein port auf Windows ist ... das rührt aber aus meiner vagen Erinnerung heraus ...
das würde ich jetzt -aus reiner Neugier- schon gern genauer wissen.
Ich denke es is so dass der Apache unter Windows (evtl. mit/wegen meiner Konfiguration!) jedem Prozess nur zwei handles gewährt ...
Microsoft selbst behauptet, dass Windows nur zwei gleichzeitige HTTP-Verbindungen zu einem Server erlaubt, und begründet das mit dem Verweis auf die Spezifikation für HTTP/1.1, nach der Clients nicht mehr als zwei gleichzeitige Verbindungen nutzen sollten. Nun ist der Apache zwar in der Regel kein Client, aber Windows ist vermutlich von Haus aus eher auf die Client-Rolle abgestimmt.
So long,
Martin
Hi,
wow, top! Danke!
ich meine mich zu erinnern, dass Apache unter Windows nicht 100% rennt .. schon gut, aber halt auch etwas eingeschränkt, weil es halt ein port auf Windows ist ... das rührt aber aus meiner vagen Erinnerung heraus ...
das würde ich jetzt -aus reiner Neugier- schon gern genauer wissen.
Naja, positiv ist das mein Erinnerungsvermögen noch nicht total verkommen ist - ich erinner(t)e mich, dass Apache 2 sehr sehr lange unter Windows als experimentell eingestuft war ... es ist mir wohl so hängen geblieben als wäre es nie die Absicht der Entwickler gewesen dass zu ändern - Verzeihung für diese dreiste und vor allem mittlerweile falsche Aussage, und nochmals danke für die super Antwort.
CLOSED
Lieber Dr.Colossos,
Weiß wer warum das in meinem Windows Szenario nicht geht?
nö, denn ich kenne Deine Apache-Config nicht.
Liebe Grüße,
Felix Riesterer.
Hi Felix,
danke für deine Antwort.
Ich hätte schon noch mehr geposted, wenn ich eine Antwort bekommen hätte, an was es in etwa liegen könnte ... ich denke nicht dass ein Post gut zu lesen ist, in dem PHP Quellcode, php.ini, phpinfo() und httpd.conf etc. einfach mal reingepasted werden ... ich habe/hatte ja keine echte Ahnung an was es liegt.
In der http.conf hätt ich schon mal nachgesehen, hab aber im Schnellverfahren nix gefunden, außer
...
ThreadsPerChild 250
MaxRequestsPerChild 0
...
Unten findest du meine httpd.conf mehr von Nöten? ... Und auch wenn ich es sehr ungern zugebe, ich nutze das WAMP Packet ... aus reiner Bequemlichkeit ... sicher nicht die beste Wahl, ich weiß dass, also macht mich nicht zu sehr nieder deswegen.
ThreadsPerChild 250
MaxRequestsPerChild 0
ServerRoot "C:/programme/wamp/bin/apache/apache2.2.6"
Listen 80
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
#LoadModule auth_digest_module modules/mod_auth_digest.so
#LoadModule authn_anon_module modules/mod_authn_anon.so
#LoadModule authn_dbm_module modules/mod_authn_dbm.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authn_file_module modules/mod_authn_file.so
#LoadModule authz_dbm_module modules/mod_authz_dbm.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule cgi_module modules/mod_cgi.so
#LoadModule dav_module modules/mod_dav.so
#LoadModule dav_fs_module modules/mod_dav_fs.so
#LoadModule deflate_module modules/mod_deflate.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
#LoadModule expires_module modules/mod_expires.so
#LoadModule file_cache_module modules/mod_file_cache.so
#LoadModule headers_module modules/mod_headers.so
LoadModule imagemap_module modules/mod_imagemap.so
LoadModule include_module modules/mod_include.so
#LoadModule info_module modules/mod_info.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
#LoadModule mime_magic_module modules/mod_mime_magic.so
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule negotiation_module modules/mod_negotiation.so
#LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
#LoadModule speling_module modules/mod_speling.so
#LoadModule status_module modules/mod_status.so
#LoadModule unique_id_module modules/mod_unique_id.so
LoadModule userdir_module modules/mod_userdir.so
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
#LoadModule ssl_module modules/mod_ssl.so
LoadModule php5_module "C:/programme/wamp/bin/php/php5.2.5/php5apache2_2.dll"
ServerAdmin webmaster@localhost
ServerName localhost:80
DocumentRoot "D:/Programming/"
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Satisfy all
</Directory>
<Directory "D:/Programming/">
Options Indexes FollowSymLinks
AllowOverride all
#
# Controls who can get stuff from this server.
#
# onlineoffline tag - don't remove
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from *removed*
Allow from *removed*
Allow from *removed*
</Directory>
<IfModule dir_module>
DirectoryIndex index.php index.php3 index.html index.htm
</IfModule>
<FilesMatch "^.ht">
Order allow,deny
Deny from all
</FilesMatch>
ErrorLog "C:/programme/wamp/logs/apache_error.log"
LogLevel warn
<IfModule log_config_module>
#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" combined
LogFormat "%h %l %u %t "%r" %>s %b" common
<IfModule logio_module>
# You need to enable mod_logio.c to use %I and %O
LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i" %I %O" combinedio
</IfModule>
#
# The location and format of the access logfile (Common Logfile Format).
# If you do not define any access logfiles within a <VirtualHost>
# container, they will be logged here. Contrariwise, if you *do*
# define per-<VirtualHost> access logfiles, transactions will be
# logged therein and *not* in this file.
#
CustomLog "C:/programme/wamp/logs/access.log" common
#
# If you prefer a logfile with access, agent, and referer information
# (Combined Logfile Format) you can use the following directive.
#
#CustomLog logs/access.log combined
</IfModule>
<IfModule alias_module>
#
# Redirect: Allows you to tell clients about documents that used to
# exist in your server's namespace, but do not anymore. The client
# will make a new request for the document at its new location.
# Example:
# Redirect permanent /foo http://localhost/bar
#
# Alias: Maps web paths into filesystem paths and is used to
# access content that does not live under the DocumentRoot.
# Example:
# Alias /webpath /full/filesystem/path
#
# If you include a trailing / on /webpath then the server will
# require it to be present in the URL. You will also likely
# need to provide a <Directory> section to allow access to
# the filesystem path.
#
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the target directory are treated as applications and
# run by the server when requested rather than as documents sent to the
# client. The same rules about trailing "/" apply to ScriptAlias
# directives as to Alias.
#
ScriptAlias /cgi-bin/ "cgi-bin/"
</IfModule>
<Directory "cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
#!c:/program files/perl/perl
DefaultType text/plain
<IfModule mime_module>
TypesConfig conf/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
</IfModule>
#MIMEMagicFile conf/magic
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://localhost/subscription_info.html
#EnableMMAP off
#EnableSendfile off
#Include conf/extra/httpd-mpm.conf
#Include conf/extra/httpd-multilang-errordoc.conf
Include conf/extra/httpd-autoindex.conf
#Include conf/extra/httpd-languages.conf
#Include conf/extra/httpd-userdir.conf
#Include conf/extra/httpd-info.conf
#Include conf/extra/httpd-vhosts.conf
#Include conf/extra/httpd-manual.conf
#Include conf/extra/httpd-dav.conf
#Include conf/extra/httpd-default.conf
#Include conf/extra/httpd-ssl.conf
# starting without SSL on platforms with no /dev/random equivalent
# but a statically compiled-in mod_ssl.
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
Include "C:/programme/wamp/alias/*"
Lieber Dr.Colossos,
zum Apachen und seiner Konfiguration gibt es einen sehr ausführlichen Artikel hier im SELFHTML-Raum. Hier die Seite Wie fängt man am besten an?, auf der Du interessante Konfigurationseinstellungen finden solltest, die auszuprobieren sich sicherlich lohnt.
Da ich am Apachen selbst sehr selten etwas verändere, kenne ich mich jetzt nicht gut genug mit der Konfigurationsdatei aus, um in Deiner geposteten config die Lösung zu finden.
Liebe Grüße,
Felix Riesterer.
Danke sehr für deine Mühen!
Ich hab zumindest einen Thread gefunden (http://mail.python.org/pipermail/python-bugs-list/2005-June/029435.html) wo das gleich Problem mit Python, (u.a.) Apache und Linux auftritt ...
Danke nochmals!