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)
-   -   [solved] Error: Compilation failed: POSIX named classes are supported only (http://www.litespeedtech.com/support/forum/showthread.php?t=6160)

dihuta 08-07-2012 06:44 PM

[solved] Error: Compilation failed: POSIX named classes are supported only
 
full title:Error: Compilation failed: POSIX named classes are supported only within a class

This error from openID class in Zend Framework. Working fine on other web server except Litespeed.

preg_match() [function.preg-match]: Compilation failed: POSIX named classes are supported only within a class at offset 21

PHP Code:

preg_match('|^([^:]+)://([^:@]*(?:[:][^@]*)?@)?([^/:@?#]*)(?:[:]([^/?#]*))?(/[^?]*)?((?:[?](?:[^#]*))?(?:#.*)?)$|'Zend_OpenId::selfUrl(), $reg)) { 

And

PHP Code:

preg_match('|^([^:]+)://([^:@]*(?:[:][^@]*)?@)?([^/:@?#]*)(?:[:]([^/?#]*))?(/[^?#]*)?((?:[?](?:[^#]*))?)((?:#.*)?)$|'$res$reg

Source file: http://framework.zend.com/svn/framew...end/OpenId.php
Line 162, 409.

I try to upgrade, downgrade php from 5.3.5 to 5.3.14 but it can not help.
Could you please help me fix this?
Thank you.

webizen 08-08-2012 04:20 PM

make sure litespeed svr has the matching PHP built as other server.

dihuta 08-08-2012 04:33 PM

Quote:

Originally Posted by webizen (Post 34633)
make sure litespeed svr has the matching PHP built as other server.



I try upgrade/downgrade all versions of PHP, same to others too, but it can not help, issue is still exist.

webizen 08-09-2012 11:27 AM

It is not just the PHP version but the compile options.

dihuta 08-09-2012 03:59 PM

Is there any advice on build option as I left other as default DirectAdmin built.

webizen 08-10-2012 11:16 AM

run from command line 'php -i' (look for Configure Command line) to get Apache php compile option and use the same options in LSWS php compile

dihuta 08-13-2012 11:51 PM

I try it, try with different php versions,

Quote:

'--with-config-file-path=/usr/local/etc/php5/cgi' '--with-curl=/usr/local/lib' '--with-gd' '--with-gettext' '--with-jpeg-dir=/usr/local/lib' '--with-freetype-dir=/usr/local/lib' '--with-kerberos' '--with-openssl' '--with-mcrypt' '--with-mhash' '--with-mysql=/usr' '--with-mysqli=/usr/bin/mysql_config' '--with-pcre-regex=/usr/local' '--with-pdo-mysql=/usr' '--with-pear' '--with-png-dir=/usr/local/lib' '--with-zlib' '--with-zlib-dir=/usr/local/lib' '--enable-zip' '--enable-gd-native-ttf' '--with-iconv=/usr/local' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-mbstring'

But that code still have error. Sample test which has error:

PHP Code:

<?php

preg_match
('|^([^:]+)://([^:@]*(?:[:][^@]*)?@)?([^/:@?#]*)(?:[:]([^/?#]*))?(/[^?]*)?((?:[?](?:[^#]*))?(?:#.*)?)$|''asdf');

?>


http://dev.vimobi.com/test.php

webizen 08-14-2012 05:20 PM

Here is the one I have. PHP 5.3.6

Configure Commands:
Quote:

'./configure' '--prefix=/usr/local/opt/lsws/lsphp5' '--with-libdir=lib64' '--with-mysqli=mysqlnd' '--with-mysql' '--enable-ftp' '--with-openssl' '--enable-pdo' '--with-pdo-mysql' '--with-zlib' '--with-gd' '--enable-shmop' '--enable-track-vars' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-magic-quotes' '--enable-mbstring' '--with-iconv' '--with-curl' '--with-mcrypt' '--with-litespeed'
test code
Code:

<?php
$subject = 'http://www.example.com/ext/url';
preg_match('|^([^:]+)://([^:@]*(?:[:][^@]*)?@)?([^/:@?#]*)(?:[:]([^/?#]*))?(/[^?]*)?((?:[?](?:[^#]*))?(?:#.*)?)$|', $subject, $matches);
print_r($matches);
?>

result
Quote:

Array
(
[0] => http://www.example.com/ext/url
[1] => http
[2] =>
[3] => www.example.com
[4] =>
[5] => /ext/url
[6] =>
)

dihuta 08-14-2012 09:30 PM

The error was fixed with your configure command.
Thanks for your support.


All times are GMT -7. The time now is 08:06 PM.