Php running error in linux!
Last Update:2017-09-15
Source: Internet
Author: User
Php running error in linux! -- Linux general technology-Linux technology and application information. For details, refer to the following section. Template_dir = STCMS_ROOT. "install/tpl"; $ smarty-> compile_dir = STCMS_ROOT. "install/cpl"; $ smarty-> switch ($ step) {case "1": $ smarty-> display ("install.html"); break; case "2 ": $ webUrl = str_replace ("\", "/", dirname ($ STCMS ['php _ SELF ']). "/"; $ smarty-> assign ("webUrl", $ webUrl); $ smarty-> display ("config.html"); break; case "3 ": if (empty ($ dbHost) die ("the Database Host cannot be blank! "); If (empty ($ dbUser) die (" the database username cannot be blank! "); If (empty ($ dbName) die (" the database name cannot be blank! "); If (empty ($ webUrl) die (" the website path cannot be blank! "); If (! $ Conn = @ mysql_connect ($ dbHost, $ dbUser, $ dbPwd) {die ("sorry, you cannot connect to the database server. Make sure that the database address, user name, and password are correct! ");} If (! @ Mysql_select_db ($ dbName, $ conn) {@ mysql_query ("create database '{$ dbName}'", $ conn);} if (! @ Mysql_select_db ($ dbName, $ conn) {die ("the database does not exist and cannot be created. Make sure that the database name is correct! ");} $ Content = file_get_contents (STCMS_ROOT. "config. inc. php "," r "); $ content = str_replace (" 'dbhost' => \ "{$ CONFIG ['dbhost']} \" ", "'dbhost' = >\" {$ dbHost} \" ", $ content ); $ content = str_replace ("'dbuser' => \" {$ CONFIG ['dbuser']} \ "", "'dbuser' = >\" {$ dbUser} \" ", $ content ); $ content = str_replace ("'dbpwd' => \" {$ CONFIG ['dbpwd']} \ "", "'dbpwd' = >\" {$ dbPwd} \" ", $ content ); $ content = str_replace ("'dbname' => \" {$ CONFIG ['dbname']} \ "", "'dbname' = >\" {$ dbName} \" ", $ content ); $ content = str_replace ("'dbprefix' => \" {$ CONFIG ['dbprefix']} \ "", "'dbprefix' = >\" {$ dbPrefix} \" ", $ content ); $ content = str_replace ("'weburl' = >\" {$ CONFIG ['weburl']} \" ", "'weburl' = >\" {$ webUrl} \" ", $ content); file_put_contents (STCMS_ROOT. "config. inc. php ", $ content); unset ($ content); echo" is set successfully. The database is being installed...
"; Require (INCLUDE_PATH. "mysql. class. php "); $ mysql = new mysql (); $ delimiter =" <{|}> "; $ dataPath = STCMS_ROOT. "install/data. SQL "; $ content = file_get_contents ($ dataPath); $ content = str_replace (" 'db _ PREFIX _ "," '{$ CONFIG ['dbprefix']} ", $ content); $ sqlArray = explode ($ delimiter, $ content); foreach ($ sqlArray as $ sqltmp) {if (trim ($ sqltmp )) $ mysql-> query ($ sqltmp);} echo "the database is successfully installed...
"; Echo" congratulations, STCMS has been installed successfully!
"; Echo" 5 seconds later transfer to the background... [the first time you log on to the background, the administrator username and password are admin] "; echo" "; Break ;}?> Error Parse error: syntax error, unexpected T_SWITCH, expecting T_STRING or T_VARIABLE or '{' or '$' in/home/www/music/install/index. php on line 19 I have never learned php. What is the error?