Web Hosting Talk







View Full Version : phpmychat.php3 and raq 4i


joubarani
06-21-2001, 10:46 AM
Hi
I have a cobalt raq 4i server and several virtual sites.
I installed phpmychat on one site and tried to run the setup but each time I did a download box open on my pc trying to download the file. And I guess that my raq is compatible with php3 since I saw in the srm.conf file the following lines:

# PHP4 (backwards compatible with php3)
AddType application/x-httpd-php4 .php3
AddType application/x-httpd-php4 .php4
AddType application/x-httpd-php4 .php
#AddType application/x-httpd-php4-source .php4s
#AddType application/x-httpd-php4-source .php3s
#AddType application/x-httpd-php4-source .phps

Could you please help me in fixing the problem and the phpmychat work on it?
Thanks in advance,

J. Joubarani:bawling:

Chicken
06-21-2001, 11:20 AM
Just wondering... in the site settings, did you enable php for this site? I'm guessing no.

joubarani
06-21-2001, 11:57 AM
Hi,
In fact yes we were enabling (Enable PHP Embedded Scripting ) in the site setting and to be more sure we disabled this option then enabled it again and retried the phpmychat script setting but we had the same thing.
Please help.


J. Joubarani

ffeingol
06-21-2001, 12:45 PM
Well you could try the following just to make sure php is working properly:

create a file called phpinfo.php and put the following in it:

<?php phpinfo() ?>

then create another file called phpinfo.php3 and put the same line in it. Go to your browser and check out the two files. They should dump out a bunch of info about how php is configured.

If you just see phpinfo() on the page, then php is not working.

If you post a url to the pages that are not working, that would help also.

Frank

eriky
06-21-2001, 02:10 PM
It's strange.. it took me very long to get .php3 files working on my raq4i.
.php works good, but php3 and phtml don't work, even if you add those lines.. I don't remember why but it works on my server now. I added something somewhere..., but that doesn't help you:(

eriky
06-21-2001, 02:13 PM
Oh i rember now.
Try:
AddType application/x-httpd-php .php3

(and not .../x-httpd-php4)

Chicken
06-21-2001, 04:21 PM
Actually, that sounds familiar.

(I know I've been driven crazy by a .pl script before, only to finally figure out that I hadn't enabled cgi for a site before heh :D)

joubarani
06-27-2001, 06:18 PM
It's work now:)

Chicken
06-27-2001, 10:45 PM
Excellent! Ohhhh, now that it is working I'll mention that I had that script on my 4r and with 20-23 users, server load was over 7.5 (384 MB ram). If the chat gets too popular (the point eh?), then you can safely reduce the levels of chatters by installing a java based chat like I did, which will drive away enough people so that you can safely return to phpchat :( :( :(

CJCS
06-28-2001, 01:03 AM
Hy,

we've tested a phpchat on our old RaQ3i with only 64MB of RAM and with nearly 20 Users the system was not heavily loaded. Approx. 2.7 and not more. Perhaps your database is not good configured ?

I've changed some settings on the database to reduce the system power it consumes. Yes i've void my warranty for the raq with changing the things but i think optimizing is even better than buying new one. :-)

We've installed an actual mysql version from source and then we start it every time with this command :

/usr/local/libexec/mysqld --user=mysql --pid-file=/var/lib/mysql/mysqld.pid --datadir=/var/lib/mysql --socket=/tmp/mysql.sock --skip-show-database --set-variable interactive_timeout=300 --set-variable wait_timeout=60 --bind-address=x.x.x.x

If you would like to connect through hostname localhost to your mysql server then do not use the --bind-address option.

This works very fine on our system and the processor power which was used through the mysql database was drastically reduced.

Greetings
Oliver

Chicken
06-28-2001, 01:55 AM
Hmmmm, that's very interesting... where were you when I needed you??? :D Well, I know very little about mysql and absolutely nothing about optimizing it. *Sigh* I wish we had this discussion a bit ago before I changed things. Pity :(

CJCS
06-28-2001, 03:30 AM
Perhaps in Holiday ? :D

I don't know much about optimizing mysql, too. But i know the mailinglists where i had to read and gather my informations from, and i like to play a little bit :D

I combine some settings and changed them a little bit to fit the needs of my users. Like finetuning a car ;)

Thats all. nothing more nothing less.

Greetings
Oliver

P.S. A good thing is perhaps to disable keep alive connections in your unix kernel for the mysql server or set the timeout down. Another thing is to disable hostname lookups from your mysql server. This will fasten up your server a little bit, because the server has not to wait for the dns server.

CJCS
06-28-2001, 04:23 AM
Hy,

here are some more infos about mysql. They are mostly from the german mysql mailing list.

MySQL and Linux Kernel 2.2

If you use a lot of concurrent connections, you may suffer from a "feature" in the 2.2 kernel that penalizes a process for forking or cloning a child in an attempt to prevent a fork bomb attack. This will cause *MySQL* not to scale well as you increase the number of concurrent clients. On single CPU systems, we have seen this manifested in a very slow thread creation, which means it may take a long time to connect to *MySQL* (as long as 1 minute), and it may take just as long to shut it down. On multiple CPU systems, we have
observed a gradual drop in query speed as the number of clients increases. In the process of trying to find a solution, we have received a kernel patch from one of our users, who claimed it made a lot of difference for his site. The patch is available here (`http://www.mysql.com/Downloads/Patches/linux-fork.patch'). We have now done rather extensive testing of this patch on both development and production systems. It has significantly improved `MySQL' performance without causing any problems and we now recommend it to our users who are still running high-load servers on 2.2 kernels. This issue has
been fixed in the 2.4 kernel, so if you are not satisfied with the current performance of your system, rather than patching your 2.2 kernel, it might be easier to just upgrade to 2.4, which will also give you a nice SMP boost in addition to fixing this fairness bug.

Tuning Linux and Mysql and PHP (translated from me)
1. echo 5 > /proc/sys/net/ipv4/tcp_keepalive_time
2. disable keepalive in httpd.conf
3. set MaxClients to 150 (PHP is not multithreaded)
4. PHP4 is not Multithreaded, this means if theres a query via PHP other PHP Scripts are not started. You should run PHP as CGI. There every Call gets his own Script. Kernel 2.4 with UMA (unified memory architecture) saves here much memory against Kernel 2.2
6. Upgrade your Network and Filehandles. Kernel 2.2 hast a Limit of 1024 open Networkconnections and open files. If a website hast 200 small images, 5 surfers make the server close. Tip : Update to Kernel 2.4, update filehandles, restart, recompile apache...

After this the server is up to 100 times faster

I hope this helps you a little bit. If someone can german he can take a look into the whole malinglist archive at
German MySQL Mailinglist (http://www.4t2.com/mysql).

Greetings
Olly

P.S. Thanks to Guido Stepken for his mails on the Mailinglist.