Preg_match() warning when moving to a new server.

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
HarmO
Power Poster
Power Poster
Posts: 251
Joined: Thu Jan 26, 2012 3:22 pm

Preg_match() warning when moving to a new server.

Post by HarmO »

Hi,

We needed a new VPS server and decided to use serverpilot.io to manage this VPS. our "old" VPS had a direct admin panel on Centos6 with php 5.4.33.
So when transfering our websites: i select php 5.4 in the serverpilot management Panel.

But after transferring database (UFT-8) and files (with tar/untar) i get the following message 8 times before outputting the websites HTML.
Warning: preg_match(): Unknown modifier 't' in /srv/users/username/apps/appname/public/lib/classes/class.CmsRoute.php on line 222
I can't seem to find the problem. A clean install with the same modules works great, but the transfer doesn't.
The only real difference that i can find is in the Server API: apache2handler(old server) vs fpm-fcgi(new server)

What goes wrong.
I would like to transfer about 15 websites to our new server.

Server infomation:

New server
______

Code: Select all

CMS Install Information
CMS Version 		1.11.13

Installed Modules
CMSMailer 		5.2.2
CMSPrinting 		1.0.5
FileManager 		1.4.5
MenuManager 		1.8.6
MicroTiny 		1.2.9
ModuleManager 		1.5.8
JQueryTools 		1.3.5.2
Search 		1.7.12
ThemeManager 		1.1.8
CGExtensions 		1.47.3
CGSmartImage 		1.18
CGSimpleSmarty 		1.8
TinyMCE 		2.9.12
ListIt2 		1.4.1
GBFilePicker 		1.3.3
CGContentUtils 		1.5.1
TemplateExternalizer 		2.1.6
ListIt2Testimonials 		1.4.1
ListIt2XDefs 		1.2
ListIt2bibtabs 		1.4.1
ListIt2Press 		1.4.1
ListIt2DoubleList 		1.0.3
ListIt2Docs 		1.4.1
ListIt2References 		1.4.1
FormBuilder 		0.7.3
ListIt2Contacts 		1.4.1
ListIt2Produits 		1.4.1
ListIt2groupesdesproduits 		1.4.1
ListIt2XLink 		1.0.2
CGBlog 		1.12.10
SiteMapMadeSimple 		1.2.8

PHP Information
Current PHP Version (phpversion) 	Success 	 5.4.45
md5 function (md5_function) 	Success 	 On (True)
GD version (gd_version) 	Success 	 2
tempnam function (tempnam_function) 	Success 	 On (True)
Magic quotes in runtime (magic_quotes_runtime) 	Success 	 Off (False)
Is E_STRICT disabled in error_reporting (E_STRICT) 	Success 	
Is E_DEPRECATED disabled in error_reporting (E_DEPRECATED) 	Success 	
PHP Effective Memory Limit (memory_limit) 	Success 	 128M
Maximum Execution Time (max_execution_time) 	Success 	 60
PHP output_buffering (output_buffering) 	Success 	 4096
PHP Safe Mode (safe_mode) 	Success 	 Off (False)
File uploads (file_uploads) 	Success 	 On (True)
Maximum Post Size (post_max_size) 	Success 	 20M
Maximum Upload Size (upload_max_filesize) 	Success 	 20M
Session Save Path (session_save_path) 	Success 	 /srv/users/username/apps/appname (0750)
Sessions are allowed to use Cookies (session_use_cookies) 	Success 	 On (True)
Basic XML (expat) support (xml_function) 	Success 	 On (True)
Checking for the XMLReader class (xmlreader_class) 	Success 	 On (True)
Checking if the httpd process can create a file inside of a directory it created (create_dir_and_file) 	Success 	
PHP register_globals (register_globals) 	Success 	 Off (False)
disable_functions in PHP (disable_functions) 	Success 	 
PHP Open Basedir (open_basedir) 	Success 	 
Test for remote URL (test_remote_url) 	Success 	
fsockopen: Connection ok! Success
fopen: Connection ok! Success
Test ini_set (check_ini_set) 	Success 	 On (True)
Test for the curl library (curl) 	Success 	 On
Test curl version (curlversion) 	Success 	 version 7.35.0, minimum recommended version is 7.19.7


Server Information
Server API (server_api) 		fpm-fcgi
Server Database (server_db_type) 		mysql (mysqli)
Server Database Version (server_db_version) 	Success 	5.5.49
Check database access levels (server_db_grants) 	Success 	found a "grant all" statement that appears to be suitable
Check for filesystem time differences (server_time_diff) 	Success 	no filesystem time difference found
Server Software (server_software) 		apache/2.4.18 (unix) openssl/1.0.1f
Server Operating System (server_os) 		linux 3.13.0-45-generic on x86_64
Timezone Offset (tz_offset) 	Success 	0 


Old server
______

Code: Select all

CMS Install Information
CMS Version 		1.11.13

Installed Modules
CMSMailer 		5.2.2
CMSPrinting 		1.0.5
FileManager 		1.4.5
MenuManager 		1.8.6
MicroTiny 		1.2.9
ModuleManager 		1.5.8
JQueryTools 		1.3.5.2
Search 		1.7.12
ThemeManager 		1.1.8
CGExtensions 		1.47.3
CGSmartImage 		1.18
CGSimpleSmarty 		1.8
TinyMCE 		2.9.12
ListIt2 		1.4.1
GBFilePicker 		1.3.3
CGContentUtils 		1.5.1
TemplateExternalizer 		2.1.6
ListIt2Testimonials 		1.4.1
ListIt2XDefs 		1.2
ListIt2bibtabs 		1.4.1
ListIt2Press 		1.4.1
ListIt2DoubleList 		1.0.3
ListIt2Docs 		1.4.1
ListIt2References 		1.4.1
FormBuilder 		0.7.3
ListIt2Contacts 		1.4.1
ListIt2Produits 		1.4.1
ListIt2groupesdesproduits 		1.4.1
ListIt2XLink 		1.0.2
CGBlog 		1.12.10
SiteMapMadeSimple 		1.2.8

PHP Information
Current PHP Version (phpversion) 	Success 	 5.4.33
md5 function (md5_function) 	Success 	 On (True)
GD version (gd_version) 	Success 	 2
tempnam function (tempnam_function) 	Success 	 On (True)
Magic quotes in runtime (magic_quotes_runtime) 	Success 	 Off (False)
Is E_STRICT disabled in error_reporting (E_STRICT) 	Caution 	E_STRICT is enabled in the error_reporting
Is E_DEPRECATED disabled in error_reporting (E_DEPRECATED) 	Success 	
PHP Effective Memory Limit (memory_limit) 	Success 	 128M
Maximum Execution Time (max_execution_time) 	Success 	 120
PHP output_buffering (output_buffering) 	Success 	 4096
PHP Safe Mode (safe_mode) 	Success 	 Off (False)
File uploads (file_uploads) 	Success 	 On (True)
Maximum Post Size (post_max_size) 	Caution 	 8M ?	
Maximum Upload Size (upload_max_filesize) 	Success 	 10M
Session Save Path (session_save_path) 	Caution 	 No check because open basedir active ?	
Sessions are allowed to use Cookies (session_use_cookies) 	Success 	 On (True)
Basic XML (expat) support (xml_function) 	Success 	 On (True)
Checking for the XMLReader class (xmlreader_class) 	Success 	 On (True)
Checking if the httpd process can create a file inside of a directory it created (create_dir_and_file) 	Success 	
PHP register_globals (register_globals) 	Success 	 Off (False)
disable_functions in PHP (disable_functions) 	Caution 	 exec, system, passthru, shell_exec, escapeshellarg, escapeshellcmd, proc_close, proc_open, dl, popen, show_source ?	
PHP Open Basedir (open_basedir) 	Caution 	 /home/username/:/tmp:/var/tmp:/usr/local/lib/php/ ?	
Test for remote URL (test_remote_url) 	Success 	
fsockopen: Connection ok! Success
fopen: Connection ok! Success
Test ini_set (check_ini_set) 	Success 	 On (True)
Test for the curl library (curl) 	Success 	 On
Test curl version (curlversion) 	Success 	 version 7.38.0, minimum recommended version is 7.19.7

Server Information
Server API (server_api) 		apache2handler
Server Database (server_db_type) 		mysql (mysqli)
Server Database Version (server_db_version) 	Success 	5.6.19
Check database access levels (server_db_grants) 	Success 	found a "grant all" statement that appears to be suitable
Check for filesystem time differences (server_time_diff) 	Success 	no filesystem time difference found
Server Software (server_software) 		apache/2
Server Operating System (server_os) 		linux 2.6.32-358.6.2.el6.x86_64 on x86_64
Timezone Offset (tz_offset) 	Success 	0 
Kind regards,
HarmO
HarmO
Power Poster
Power Poster
Posts: 251
Joined: Thu Jan 26, 2012 3:22 pm

Re: Preg_match() warning when moving to a new server.

Post by HarmO »

The error does not occur on pages when the the content is generated by a module. Only on standard pages.

i aslo was able to suppers the error by adding the @ sign on line 222 of class.CmsRoute.php, but that is not a correct solution.

Please help...
Kind regards,
HarmO
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Preg_match() warning when moving to a new server.

Post by velden »

Obvious: clear cache in CMSMS admin

Check if PHP error_reporting is the same on both installs (maybe the warnings are just hidden on your old server)

Update Routes (same admin page as clear cache).

Create a checksum file in CMSMS admin of the 'orginal' install and use that to check on the 'failing' install.

Just to make sure that there aren't files corrupted during the migration.

Then - if you're altering core files anyway - temporarily add a line to print the values that are passed to the preg_match function.

Just BEFORE line 222:

Code: Select all

debug_display(sprintf('term: %s',$this->_data['term']));
Do this on both installs and compare output for same page(s).
You're searching for lines where 'term' ends like '/t'

Check if it differs between both installs. If it differs I'd expect the database isn't migrated properly.

EDIT: of course you should upgrade to a supported version soon.
HarmO
Power Poster
Power Poster
Posts: 251
Joined: Thu Jan 26, 2012 3:22 pm

Re: Preg_match() warning when moving to a new server.

Post by HarmO »

Thanks Velden,

I had done the checksome before and detect no errors...
But i'll trie the other points you mentioned to see what the difference is on both servers.
Kind regards,
HarmO
HarmO
Power Poster
Power Poster
Posts: 251
Joined: Thu Jan 26, 2012 3:22 pm

Re: Preg_match() warning when moving to a new server.

Post by HarmO »

1000 times Thanks Velden,

due to your line of code i was able to detect the problem.
It was a list it module with a / in its "URL Prefix"-value.
Kind regards,
HarmO
Post Reply

Return to “The Lounge”