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

Go Back   LiteSpeed Support Forums > External Applications > PHP > [solved] Error: Compilation failed: POSIX named classes are supported only

Reply
 
Thread Tools Display Modes
  #1  
Old 08-07-2012, 06:44 PM
dihuta dihuta is offline
Member
 
Join Date: Oct 2010
Posts: 37
Default [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.

Last edited by NiteWave; 08-14-2012 at 10:16 PM..
Reply With Quote
  #2  
Old 08-08-2012, 04:20 PM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,337
make sure litespeed svr has the matching PHP built as other server.
Reply With Quote
  #3  
Old 08-08-2012, 04:33 PM
dihuta dihuta is offline
Member
 
Join Date: Oct 2010
Posts: 37
Quote:
Originally Posted by webizen View Post
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.
Reply With Quote
  #4  
Old 08-09-2012, 11:27 AM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,337
It is not just the PHP version but the compile options.
Reply With Quote
  #5  
Old 08-09-2012, 03:59 PM
dihuta dihuta is offline
Member
 
Join Date: Oct 2010
Posts: 37
Is there any advice on build option as I left other as default DirectAdmin built.
Reply With Quote
  #6  
Old 08-10-2012, 11:16 AM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,337
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
Reply With Quote
  #7  
Old 08-13-2012, 11:51 PM
dihuta dihuta is offline
Member
 
Join Date: Oct 2010
Posts: 37
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
Reply With Quote
  #8  
Old 08-14-2012, 05:20 PM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,337
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] =>
)
Reply With Quote
  #9  
Old 08-14-2012, 09:30 PM
dihuta dihuta is offline
Member
 
Join Date: Oct 2010
Posts: 37
The error was fixed with your configure command.
Thanks for your support.
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


All times are GMT -7. The time now is 11:57 AM.



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