LiteSpeed Support Forums

LiteSpeed Support Forums (http://www.litespeedtech.com/support/forum/index.php)
-   PHP (http://www.litespeedtech.com/support/forum/forumdisplay.php?f=19)
-   -   PDO extension (http://www.litespeedtech.com/support/forum/showthread.php?t=5002)

tophostingcenter 05-23-2011 12:49 PM

PDO extension
 
Hello,

We want to know how to add "PDO extension" in litespeed.

Can you give us the steps please.

Thank you
Eric

webizen 05-23-2011 02:57 PM

you can add "PDO extension" in LSPHP in two ways:
1. recompile lsphp
you need to go through LSPHP compile process (http://www.litespeedtech.com/support...wiki:php:lsapi) with "--with-pdo-extension" or "--with-pdo-extension=shared" option added. put "extension=pdo-extension.so" in php.ini for shared object built.

2. dynamic shared extension (no lsphp recompile)
build dynamic shared object from source as indicated in http://www.litespeedtech.com/support...p:opcode_cache. there is no need to recompile PHP for this.

tophostingcenter 05-24-2011 06:13 AM

PDO extension
 
Hello webizen,

Thank you very much for your quick reply.

I'm assuming also that if we have already some -with... that I will have to include them and add the other options as well or during the compilation Litespeed will include the current options automatically + the new ones that I will add ?

regards
eric

webizen 05-24-2011 09:40 AM

Yes, you need to include what you already have and ADD the new options.

tophostingcenter 05-24-2011 09:48 AM

Thank you very much !

Eric

tophostingcenter 05-26-2011 05:52 PM

Hello,

We have done what you have mentioned, but we cannot see anymore the php-extension.so, what are your recommendations?

regards
eric

webizen 05-26-2011 07:19 PM

paste here your existing php compile options.

tophostingcenter 05-26-2011 07:30 PM

Hello,

Here :

'./configure' '--prefix=/usr/local/lsws/lsphp5' '--with-bz2' '--enable-ctype' '--enable-dba' '--enable-ftp' '--with-gettext' '--enable-mbstring=all' '--with-gd' '--with-mhash' '--with-mcrypt=/usr/local/lsws/phpbuild/php-5.3.2/ext/' '--with-openssl=/usr' '--enable-overload' '--enable-posix' '--enable-session' '--enable-sockets' '--enable-standard' '--enable-tokenizer' '--with-xml' '--with-xsl' '--with-zip' '--with-zlib' '--with-zlib-dir' '--with-freetype-dir' '--with-png-dir' '--with-jpeg-dir' '--with-expat-dir' '--with-iconv-dir' '--with-libxml-dir' '--enable-gd-native-ttf' '--with-ttf' '--enable-mbstr-enc-trans' '--with-expat-dir' '--with-xslt-sablot' '--with-gnu-ld' '--with-curl' '--with-curlwrappers' '--with-dom' '--with-dom-xslt' '--with-dom-exsltd' '--with-dom' '--with-fileinfo' '--with-gmp' '--with-iconv' '--with-imap' '--with-imap-ssl' '--with-mcal' '--with-mysql=/usr' '--with-mysqli=shared' '--with-pgsql=/usr' '--with-sqlite=shared' '--enable-sqlite-utf8' '--with-xmlrpc' '--enable-htscanner' '--enable-track-vars' '--enable-trans-sid' '--enable-memory-limit' '--enable-magic-quotes' '--with-pear' '--with-mime-magic' '--with-inifile' '--with-flatfile' '--enable-pdo=shared' '--with-pdo-sqlite=shared' '--with-pdo-mysql=shared' '--with-pdo-pgsql=shared' '--enable-sysvshm' '--enable-sysvsem' '--enable-shmop' '--with-kerberos' '--enable-suhosin' '--with-litespeed' '--with-pdo-extension=shared'

---
This is the error message from the application that needs the PDO Extension

FATAL ERROR: MODx Setup cannot continue.

* MODx requires the PDO extension when native PDO is being used and it does not appear to be loaded.
---

Thank you
Eric

webizen 05-26-2011 09:40 PM

you already have needed options: '--enable-pdo=shared' '--with-pdo-sqlite=shared' '--with-pdo-mysql=shared' '--with-pdo-pgsql=shared'.

make sure extension_dir in your php.ini points to the place holds all the so files.

the path to php.ini should be
Quote:

/usr/local/lsws/fcgi-bin/lsphp5 -i | grep "Loaded Configuration File"
also include the shared module(s) in php.ini like
Quote:

extension=pdo.so;
extension=pdo_mysql.so;
...
then make a phpinfo page to verify if these modules are loaded by make a request to that page (http://test.yourdomain.com/phpinfo.php).

Quote:

echo "<?php phpinfo(); ?>" > phpinfo.php

tophostingcenter 05-27-2011 01:30 PM

Hi,

Didn't work.

Here the php.ini section where I added the extensions:

--
[PHP]
engine = 1
zend.ze1_compatibility_mode =
short_open_tag = 1
asp_tags =
precision = 14
y2k_compliance = 1
output_buffering = 4096
zlib.output_compression =
implicit_flush =
unserialize_callback_func =
serialize_precision = 100
allow_call_time_pass_reference =
safe_mode =
safe_mode_gid = 1
safe_mode_include_dir =
safe_mode_exec_dir =
safe_mode_allowed_env_vars = PHP_
safe_mode_protected_env_vars = LD_LIBRARY_PATH
disable_functions =
disable_classes =
highlight.string = #DD0000
highlight.comment = #FF9900
highlight.keyword = #007700
highlight.bg = #FFFFFF
highlight.default = #0000BB
highlight.html = #000000
expose_php = 1
max_execution_time = 50
max_input_time = 60
memory_limit = 128M
error_reporting = E_ALL & ~E_DEPRECATED
display_errors = 0
display_startup_errors =
log_errors = 1
log_errors_max_len = 1024
ignore_repeated_errors =
ignore_repeated_source =
report_memleaks = 1
track_errors =
html_errors =
error_log = /hsphere/local/var/httpd/logs/php_error.log
variables_order = EGPCS
register_globals = 1
register_long_arrays = 1
register_argc_argv = 1
auto_globals_jit = 1
post_max_size = 8M
magic_quotes_gpc = 1
magic_quotes_runtime =
magic_quotes_sybase =
auto_prepend_file =
auto_append_file =
default_mimetype = text/html
always_populate_raw_post_data = 1
include_path = .:/usr/local/lsws/phpbuild/php-5.3.2/ext
doc_root =
user_dir =
extension_dir = /usr/local/lsws/phpbuild/php-5.3.2/ext/
cgi.fix_pathinfo = 1
file_uploads = 1
upload_tmp_dir =
upload_max_filesize = 100M
allow_url_fopen = 1
allow_url_include =
default_socket_timeout = 60
auto_detect_line_endings = 1
extension=pdo.so;
extension=pdo_mysql.so;
extension=pdo-extension.so;
--

I have checked if the pdo.so, pdo_mysql.so and pdo-extension.so were in extension_dir = /usr/local/lsws/phpbuild/php-5.3.2/ext/ and they are there
drwxr-xr-x 4 lsadm lsadm 4096 Jun 12 2010 pdo
drwxr-xr-x 2 lsadm lsadm 4096 Mar 3 2010 pdo_dblib
drwxr-xr-x 3 lsadm lsadm 4096 Mar 3 2010 pdo_firebird
drwxr-xr-x 4 lsadm lsadm 4096 Jun 12 2010 pdo_mysql
drwxr-xr-x 3 lsadm lsadm 4096 Mar 3 2010 pdo_oci
drwxr-xr-x 3 lsadm lsadm 4096 Mar 3 2010 pdo_odbc
drwxr-xr-x 4 lsadm lsadm 4096 Jun 12 2010 pdo_pgsql
drwxr-xr-x 4 lsadm lsadm 4096 Jun 12 2010 pdo_sqlite

Also please refer to the info.php page to have a better view.

http://www.gongcha.ph/info.php

===

The issue is they don't load, what is the solution ?

regards
eric


All times are GMT -7. The time now is 04:47 PM.