LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Install/Configuration > PHP FCGI Module and Mysql 4.x+

Reply
 
Thread Tools Display Modes
  #1  
Old 08-26-2003, 06:22 AM
odie odie is offline
New Member
 
Join Date: Aug 2003
Posts: 5
Default PHP FCGI Module and Mysql 4.x+

When i trie to load my PHPWebsite scripts i get an error:
"Unable to load database indicated by configuration file."
It works fine (but slow) under Apache.

What do i have to do to make PHP FastCGI access the 4.1 MySQL DB?

I use MySQL 4.1a on RH9 (all updates applied) / Apache 1.3.27 / PHP 4.3.1 system.
Reply With Quote
  #2  
Old 08-26-2003, 08:38 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Thank you for trying our web server.

By default, PHP looks for MySQL's socket at /tmp/mysql.sock, it is configurable in php.ini. RedHat usually place MySQL's socket somewhere else, see your /etc/my.cnf. Both configuration should match.

Your problem may caused by the missing php.ini if you are using the prebuilt PHP binary coming with our installation package, it is configured to search php.ini under ../conf/ instead of /usr/local/lib/. One quick solution is to copy /usr/local/lib/php.ini to [lsws_home]/conf, restart server or just kill all PHP processes.

Only FastCGI interface is enabled in the prebuilt PHP binary, so if you need any features that are missing, you need to build PHP from source, for detail, please read respective HOWTO. Please stay with 4.3.1 if you can, as newer versions are bugy in fast CGI interface.

If your site is database and/or PHP script intensive, you may not observe big performance boost by switching to our server unless it is under extreme load, Apache could become really slow. If you want you can run both web servers on different ports in parallel and "ab" them. You also can try PHP Accelerator see if it help.

We'd like to know how is our web server against Apache, please post your impression if possible.

Best regards,
Mistwang
Reply With Quote
  #3  
Old 08-26-2003, 08:45 AM
odie odie is offline
New Member
 
Join Date: Aug 2003
Posts: 5
Does PHP Accelerator work with 4.3.1? The latest binary version i found was made for 4.3.0. Any idea? (And do you know where to place the zend_extension tag in php.ini? Tried but got no working results.)
Reply With Quote
  #4  
Old 08-26-2003, 09:26 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Yes, it works.
I put zend_extension tag just below "dynamic extensions", do a search.
Remember to kill all PHP processes after configuration changes.
Load /phpinfo.php in your browser, PHP accelerator should appear in the copyright section.

BTW: I assume your web site works now, isn't it? :-)

Best regards,
Mistwang
Reply With Quote
  #5  
Old 08-26-2003, 09:32 AM
odie odie is offline
New Member
 
Join Date: Aug 2003
Posts: 5
Not really. PHPA has a shm prob... I try something else. Yo, i have Turck MMCache up and running. Its pretty fast (Even faster than Zend).
Reply With Quote
  #6  
Old 08-26-2003, 09:59 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Cool!

Last time I have difficulties to compile Turck MMCache with PHP. I will try it later.

So your new PHP binary can connect to MySQL too, I assume.

Best regards,
Gang
Reply With Quote
  #7  
Old 08-26-2003, 10:17 AM
odie odie is offline
New Member
 
Join Date: Aug 2003
Posts: 5
Yes. It needed a ./configure --with-mysql=/usr and compiled fine using MySql 4.0.14 (table cache switched on) using the 3.x compatibility libs.

I compiled Turck as written on their page:

export PHP_PREFIX="/usr"
$PHP_PREFIX/bin/phpize
./configure --enable-mmcache=shared --with-php-config=$PHP_PREFIX/bin/php-config
make

Then i copied the .so manually to /usr/lib/php4 and added this config lines after all other modules:

extension="mmcache.so"
mmcache.shm_size="16"
mmcache.cache_dir="/tmp/mmcache"
mmcache.enable="1"
mmcache.optimizer="1"
mmcache.check_mtime="1"
mmcache.debug="0"
mmcache.filter=""
mmcache.shm_max="0"
mmcache.shm_ttl="0"
mmcache.shm_prune_period="0"
mmcache.shm_only="0"
mmcache.compress="1"

The cache dir has to be set up manually:

mkdir /tmp/mmcache
chmod 0777 /tmp/mmcache
Reply With Quote
  #8  
Old 08-26-2003, 10:38 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Cool!

I compiled MMCache successfully too this time. It is nice to have another option for PHP acceleration.

Thank you for your information.
If you have any comments, suggestions or criticism, please let us know.

Best regards,
Mistwang
Reply With Quote
  #9  
Old 08-27-2003, 11:06 AM
odie odie is offline
New Member
 
Join Date: Aug 2003
Posts: 5
Compared your free Edition now with a Tux/Apache 1.3.27/PHP 4.3.1/MySQL 4.0.14/Turck MMCache Combo and they seem both fast, yours a tick faster with PHPWebsite 9.03.1. Both used the same DB and accelerating libs.

You should compile your PHP fcgi executable with mysql shared since PHP seems to take no other shared mods if there is not at least one mod compiled shared. I tried 4.3.3 and it worked fine this way.

PHP Options (change paths):

./configure --prefix=/usr/local/thunder \
--with-config-file-path=/usr/local/thunder/etc \
--enable-shared \
--enable-fastcgi \
--enable-discard-path \
--enable-force-cgi-redirect \
--with-mysql=shared,/usr/local/thunder \
--with-zlib

From PHP.ini:

output_buffering = On
zlib.output_compression = 16KB
...
extension=mysql.so
extension=mmcache.so
mmcache.shm_size="16"
mmcache.cache_dir="/usr/local/thunder/tmp/mmcache"
mmcache.enable="1"
mmcache.optimizer="1"
mmcache.check_mtime="1"
mmcache.debug="0"
mmcache.filter=""
mmcache.shm_max="0"
mmcache.shm_ttl="0"
mmcache.shm_prune_period="0"
mmcache.shm_only="0"
mmcache.compress="1"

MySQL Speedup 4.x:
query_cache_size = 16000000

PHPWebsite performs nicely now on my good old HP E45 (PII 266/192MB RAM). Before it was a nightmare. ;-)

You need some beta testers for the commercial litespeed version? I would!
(The config interface is really a lot nicer than Apache/Webmin.
And there is no config interface for lighttpd wich i would try next... *g*)

BTW: Somewhere should be a real fat headline "Chmod your static files to 644 in oder to see them" for n00bs like me. :-)
Reply With Quote
  #10  
Old 08-27-2003, 09:33 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Thank you for the update and suggestion. :-)

PHP 4.3.3 has problem when PATH_INFO is popluated. The PHP_SELF is set to PATH_INFO instead of SCRIPT_NAME. We submitted bug report but it is not resolved completely since 4.3.2. Also 4.3.2 and above should be configured with --disable-path-info-check. So we still recommend 4.3.1.

User should build PHP binary from source if they need extra features. It is hard to build one that will make everyone happy. :-) Your suggestion can be added in the documentation though.

I have no problem to use the acceleration modules with the prebuilt PHP.

I just took a look at lighttpd, and I believe it will show similiar performance as our product. But our server does not take advantage of any fancy API like sendfile() or SIGIO yet.

Sorry for not clearly stating the permission about the static file. It will be added in the trouble shooting section in the document. It is one of our secuirty feature to prevent accidentally serve content that is not intended to be served by web server.

We do need beta testers and appreciate any help. I will send your the beta release to your registered email, is that OK? Or you can send email to info@litespeedtech.com. Another beta user Paul from pizza.org help us a lot. :-)
If you happen to have an account on freshmeat.net, you can subscribe to our project too.

Best regards,
Mistwang
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL Authentication rsilva Feedback/Feature Requests 3 08-11-2006 09:38 PM


All times are GMT -7. The time now is 10:46 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.