Page 1 of 1

[SOLVED] ERROR after moving from one server to localhost

Posted: Wed Oct 27, 2010 8:21 am
by malinius
Hi, I'm running CMS Made Simple 1.6.6.
I'm using PHP 5.3.1, MySQL 5.1.41. This is all working with Apache/2.2.14 (Win32) running on Windows XP;

I've tried to move my CMS from one server to another (my localhost) using your instruction manual (http://wiki.cmsmadesimple.org/index.php ... New_Server) following those 4 steps provided in "How to move your CMSms installation to a new server (1)" section.

I've copied the files and DataBase to new location, changed the settings from config.php file, but when I try to access the site, I've get a parser error: "Parse error: syntax error, unexpected $end in C:\xampp\xampp\htdocs\public_html_new\modules\SimpleSlider\SimpleSlider.module.php on line 194" (at this line there's a php tag closing, is the last line from the file) along with some php code:

Code: Select all

CMSModule(); } function GetName(){ return 'SimpleFeedback'; } function GetFriendlyName() { return 'Manage Simple Feedback'; } function SetParameters(){ $this->RegisterRoute('/simplefeedback\/sendfeed$/', array('action'=>'sendfeed')); } function Install() { global $gCms; //Get a reference to the database $db = $this->cms->db; // mysql-specific, but ignored by other database $taboptarray = array('mysql' => 'TYPE=MyISAM'); //Make a new "dictionary" (ADODB-speak for a table) $dict = NewDataDictionary($db); //Add the fields as a comma-separated string. $flds = "id I DEFAULT 0, name C(100), email C(100) "; //Note the naming scheme that should be followed when adding tables to the database, // so as to make it easy to recognize who the table belongs to, and to avoid conflict with other modules. $sqlarray = $dict->CreateTableSQL(cms_db_prefix().'module_simplefeedback_settings', $flds, $taboptarray); $dict->ExecuteSQLArray($sqlarray); $fields=array(); $fields['name']=""; $fields['email']=""; $sql=$this->GenerateInsertSQL(cms_db_prefix().'module_simplefeedback_settings', $fields); $db->Execute($sql); if($this->debug){ //echo $sql; echo $db->ErrorMsg(); } //Add the fields as a comma-separated string. $flds = "catid I AUTO KEY, name C(100) "; //Note the naming scheme that should be followed when adding tables to the database, // so as to make it easy to recognize who the table belongs to, and to avoid conflict with other modules. $sqlarray = $dict->CreateTableSQL(cms_db_prefix().'module_simplefeedback_cats', $flds, $taboptarray); $dict->ExecuteSQLArray($sqlarray); $db->CreateSequence(cms_db_prefix().'module_simplefeedback_cats_seq'); $fields=array(); $fields['name']="Sales"; $fields['catid']=$db->GenID(cms_db_prefix()."module_simplefeedback_cats_seq"); $sql=$this->GenerateInsertSQL(cms_db_prefix().'module_simplefeedback_cats', $fields); $db->Execute($sql); if($this->debug){ //echo $sql; echo $db->ErrorMsg(); } $fields=array(); $fields['name']="Technical"; $fields['catid']=$db->GenID(cms_db_prefix()."module_simplefeedback_cats_seq"); $sql=$this->GenerateInsertSQL(cms_db_prefix().'module_simplefeedback_cats', $fields); $db->Execute($sql); if($this->debug){ //echo $sql; echo $db->ErrorMsg(); } $fields=array(); $fields['name']="Enquiry"; $fields['catid']=$db->GenID(cms_db_prefix()."module_simplefeedback_cats_seq"); $sql=$this->GenerateInsertSQL(cms_db_prefix().'module_simplefeedback_cats', $fields); $db->Execute($sql); if($this->debug){ //echo $sql; echo $db->ErrorMsg(); } $fields=array(); $fields['name']="Business"; $fields['catid']=$db->GenID(cms_db_prefix()."module_simplefeedback_cats_seq"); $sql=$this->GenerateInsertSQL(cms_db_prefix().'module_simplefeedback_cats', $fields); $db->Execute($sql); if($this->debug){ //echo $sql; echo $db->ErrorMsg(); } $fields=array(); $fields['name']="Others"; $fields['catid']=$db->GenID(cms_db_prefix()."module_simplefeedback_cats_seq"); $sql=$this->GenerateInsertSQL(cms_db_prefix().'module_simplefeedback_cats', $fields); $db->Execute($sql); if($this->debug){ //echo $sql; echo $db->ErrorMsg(); } $this->CreatePermission('SimpleFeedback Admin', 'SimpleFeedback Admin'); $this->setPreference('email', ''); $this->setPreference('name', ''); $this->setPreference('success', ''); $this->setPreference('captcha', 'false'); $this->setPreference('after', ''); $this->setPreference('before', ''); $this->setPreference('showcontact', 'true'); $this->setPreference('showname', 'true'); $this->setPreference('showemail', 'true'); $this->setPreference('showcompany', 'true'); } function Upgrade($oldversion, $newversion){ $db = $this->cms->db; //Remove the database table $dict = NewDataDictionary( $db ); switch($oldversion){ case '0.2': break; case '0.1': case '0.1.2': $sqlarray = $dict->DropTableSQL( cms_db_prefix().'module_simplefeedback_settings' ); $dict->ExecuteSQLArray($sqlarray); break; } } function Uninstall() { $db = $this->cms->db; $dict = NewDataDictionary( $db ); $sqlarray = $dict->DropTableSQL( cms_db_prefix().'module_simplefeedback_cats' ); $dict->ExecuteSQLArray($sqlarray); //Remove the sequence $db->DropSequence( cms_db_prefix().'module_simplefeedback_cats_seq' ); $this->RemovePermission('SimpleFeedback Admin'); $this->RemovePreference(); } function GetVersion() { return '0.2.1'; } function GetHelp() { return '
Developed by AGA IT Solutions.

Simply put {cms_module module=\'SimpleFeedback\'} anywhere you would like to have the feedback form.

The response will be emailed to the address set in the control panel under Extensions. You can also change the categories using the control panel.

'; } function IsPluginModule() { return true; } function HasAdmin()	{ return true; } function GetAdminSection() { return 'extensions'; } function GetAdminDescription() { return 'Manage Simple Feedback'; } function displaySelectArray($selectlist, $id=0){ foreach($selectlist as $key => $val){ ?> 
Parse error: syntax error, unexpected $end in C:\xampp\xampp\htdocs\public_html_new\modules\SimpleSlider\SimpleSlider.module.php on line 194
I've discovered that if I comment this line "$modload->LoadModules(isset($LOAD_ALL_MODULES), !isset($CMS_ADMIN_PAGE));" from my include.php file, the site is displayed with some elements missing...

This was working before on the previous server.

Thank you for your support!

Re: ERROR after moving from one server to localhost

Posted: Wed Oct 27, 2010 2:15 pm
by Coldman
Are you sure that you have changed all settings?

This part confuses me

Code: Select all

"C:\xampp\xampp\htdocs\public_html_new\modules\SimpleSlider\SimpleSlider.module.php on line 194"
The new install is it on C:\xampp ?

Re: ERROR after moving from one server to localhost

Posted: Wed Oct 27, 2010 2:22 pm
by malinius
Coldman wrote: Are you sure that you have changed all settings?

This part confuses me

Code: Select all

"C:\xampp\xampp\htdocs\public_html_new\modules\SimpleSlider\SimpleSlider.module.php on line 194"
The new install is it on C:\xampp ?
Yes, I'm sure...
I'm trying to run this CMS on my localhost (using XAMPP)...

I haven't installed CMS Made Simple on my PC, I've just copied all the files from the other server (which is working now) to my PC like it said in the "manual": "
Step 3
Copy the Files:
Using your FTP software, copy all of the files from your old site to your new site. Remember to check the permissions for the folders on the new site to ensure they are set correctly, i.e. all cache, uploads and any other folders or sub-folders that need to be writeable, are writeable.
"

Here is a preview of my config.php file:

Code: Select all

<?php
#Sorry, this config variable is not recognized.
$config['php_memory_limit'] = '';
#Sorry, this config variable is not recognized.
$config['process_whole_template'] = false;
#This is the database type you would like to use. In 1.02 without modifications the values "mysqli","mysql", and "postgres7" are valid. With ADOdb Full and an SVN version, "sqlite" is also valid.
$config['dbms'] = 'mysql';
#The database hostname is the address of the database server. In most cases this is "localhost", however if "localhost" does not work, and you do not know, you will need to ask your hosting provider.
$config['db_hostname'] = 'localhost';
#The database username is the username used to connect to the database.
$config['db_username'] = 'xxx';
#The database password is the password used to connect to the database.
$config['db_password'] = 'xxx';
#The database name is the name of the database you picked when installing CMSMS
$config['db_name'] = 'temporary_db';
#Sorry, this config variable is not recognized.
$config['db_port'] = '';
#This is the prefix of all the tables in the database. This is useful if you need to install more than one application in a single database. Default is "cms_"
$config['db_prefix'] = 'cms_';
#The document root as seen by a browser, no slash at the end.
$config['root_url'] = 'http://localhost/public_html_new';
#The document root as seen by PHP(directory this file is in). No slash at the end.
$config['root_path'] = 'C:/xampp/xampp/htdocs/public_html_new';
#If you aren't using mod_rewrite or interal pretty urls, what would you like the query variable to be. Default is "page"
$config['query_var'] = 'page';
#Sorry, this config variable is not recognized.
$config['use_bb_code'] = false;
#Enable Smarty PHP tags? Smarty PHP tags look like {php}VALID PHP CODE HERE{/PHP}. They will allow you, and anyone that can use smarty on your system, to execute custom PHP code.
$config['use_smarty_php_tags'] = false;
#Where do previews(used throughout CMSMS) get stored? It defaults to tmp/cache
$config['previews_path'] = 'C:/xampp/xampp/htdocs/public_html_new/tmp/cache';
#Where do uploads get stored(as seen by PHP)? It defaults to uploads
$config['uploads_path'] = 'C:/xampp/xampp/htdocs/public_html_new/uploads';
#What is the URL to the uploads directory(as seen by a browser)?
$config['uploads_url'] = 'http://localhost/public_html_new/uploads';
#The max size of file that can be uploaded. This must be in bytes.
$config['max_upload_size'] = '2000000';
#Enable Debugging? This will cause CMSMS to send information useful for debugging to the browser. Only turn this on if something is broken, and never turn it on on a live server.
$config['debug'] = false;
#Sorry, this config variable is not recognized.
$config['output_compression'] = false;
#Sorry, this config variable is not recognized.
$config['url_rewriting'] = 'none';
#If you're using the internal pretty url mechanism or mod_rewrite, would you like toshow urls in their hierarchy?  (ex. http://www.mysite.com/parent/parent/childpage)
$config['use_hierarchy'] = true;
#Automatically Assign Page Alias? This will cause CMSMS to assign a page alias from the title of a page(if you don't specify one).
$config['auto_alias_content'] = true;
#What program should be used to produce thubmnails of images? Valid intries are "GD","ImageMagick", and "NetPBM". See <a href="http://wiki.cmsmadesimple.org/index.php/User_Handbook/Admin_Panel/Content/Image_Manager">http://wiki.cmsmadesimple.org/index.php/User_Handbook/Admin_Panel/Content/Image_Manager</a> for more info.
$config['image_manipulation_prog'] = 'GD';
#The path to the binary files for ImageMagick or NetPMB(if they are used).
$config['image_transform_lib_path'] = '/usr/bin/ImageMagick/';
#Path to upload images to(as seen by PHP).
$config['image_uploads_path'] = 'C:/xampp/xampp/htdocs/public_html_new/uploads/images';
#URL to images uploads path(as seen by a browser)
$config['image_uploads_url'] = 'http://localhost/public_html_new/uploads/images';
#Encoding used for the frontend of CMSMS. In almost all cases it should be left balnk.
$config['default_encoding'] = 'utf-8';
#Not used anymore. Kept around, just in case.
$config['disable_htmlarea_translation'] = false;
#Name of the admin directory.
$config['admin_dir'] = 'admin';
#Determines whether a persistent database connection should be used. This is generally faster, but not all hosts allow it.
$config['persistent_db_conn'] = false;
#The permissions that will be used on uploads.This is same permission scheme used by chmod. Read about it <a href="http://www.faqts.com/knowledge_base/view.phtml/aid/24443">here</a>. Defaults to 664, and only really needs to be changed if your host has weird restrictions.
$config['default_upload_permission'] = '664';
#Extension to use if you're using mod_rewrite for pretty URLs.
$config['page_extension'] = '';
#Whether to use ADOdb lite or its big brother ADOdb. ADOdb is bigger and slower, but supports SQLite. If you would like to enable this you must download ADOdb from their sourceforge page and place it in the directory lib/adodb.
$config['use_adodb_lite'] = true;
#Locale to use for various default date handling functions, etc.  Leaving this blank will use the server's default.  This might not be good if the site is hosted in a different country than it's intended audience.
$config['locale'] = '';
#URL of the Admin Panel section of the User Handbook.This is used to generate the help links throughout CMSMS' admin section. You <i>change</i> this to your own help system, but I don\t see why you would want to.
$config['wiki_url'] = 'http://wiki.cmsmadesimple.org/index.php/User_Handbook/Admin_Panel';
#Sets Description
$config['set_names'] = true;
#Encoding used for the backend of CMSMS. In almost all cases it should be "utf-8". Changing this can slow CMSMS' admin interface done tremendously
$config['admin_encoding'] = 'utf-8';
#If you don't use mod_rewrite, then would you like to use the built-inpretty url mechanism?  This will not work with IIS and the {metadata} tagshould be in all of your templates before enabling.
$config['internal_pretty_urls'] = false;
#Assume mod_rewrite? Turn this on to produce mod_rewrite urls in the menu.
$config['assume_mod_rewrite'] = false;
?>

Re: ERROR after moving from one server to localhost

Posted: Wed Oct 27, 2010 3:54 pm
by Coldman
When you transferred the files via FTP maybe some error occurred.
It feels like one or more files were not transferred correctly.

Re: ERROR after moving from one server to localhost

Posted: Wed Oct 27, 2010 5:38 pm
by Dr.CSS
CMS Made Simple 1.6.6 can't use PHP 5.3.1...

Re: ERROR after moving from one server to localhost

Posted: Wed Oct 27, 2010 6:42 pm
by malinius
Dr.CSS wrote: CMS Made Simple 1.6.6 can't use PHP 5.3.1...
Thank you a lot Dr.CSS. This was the issue. After I've installed PHP 5.2.8, the site worked fine. On my other server, this was the PHP version used (that's why it worked)...
Also, thank you Coldman for your answers...