简体   繁体   English

脚本可以在Wamp服务器上运行,但不能在我的VPS上运行

[英]script works on wamp server but not on my vps

Alright so I'm working on a forum project and I've ran into a snag. 好吧,所以我正在做一个论坛项目,遇到了麻烦。 Uploading all my of files into wamp and starting the install process all goes fine. 将我所有的文件上传到wamp中,并开始安装过程,一切正常。 However when I upload the same files to my live website (using whm & cpanel) I go through the install process and when I get to index_3.php and type in all the server information I click continue and boom white screen, no errors. 但是,当我将相同文件上传到我的实时网站(使用whm和cpanel)时,我会经历安装过程,当我进入index_3.php并键入所有服务器信息时,我单击继续并出现白屏,没有错误。 I checked my php.ini and turned display errors on and nothing. 我检查了php.ini并打开了显示错误,什么也没有。 Checked the cpanel error log, nothing... 检查了cpanel错误日志,什么都没有...

my index_3.php file: 我的index_3.php文件:

 <?php if (!file_exists( "install.txt")){ die( "Installer locked."); } ?> <!doctype html> <html> <head> <title>forum Installer - Step 3 of 7</title> <link rel="stylesheet" type="text/css" href="css/installer.css" /> </head> <body> <div id="wrap"> <img src="images/mbbinstall_logo.png" /> <div id="container"> <div id="menu"> <a href="#" class="current"> <img src="images/green/welcome.png" alt="Y">Welcome to forum!</a> <a href="#" class="current"> <img src="images/green/percheck.png" alt="Y">Check Permissions</a> <a href="#" class="current"> <img src="images/grey/mysql.png" alt="Y">Configure MySQL</a> <a href="#"> <img src="images/grey/settings.png" alt="N">Configure Settings</a> <a href="#"> <img src="images/grey/table.png" alt="N">Install Tables</a> <a href="#"> <img src="images/grey/account.png" alt="N">Create Admin Account</a> <a href="#"> <img src="images/grey/forum.png" alt="N">Your New Forum</a> </div> <div id="content"> <div class="title">forum MySQL Configuration</div> <div class="title2">Step 3 of 7</div> <?php if (isset($_GET[ "error"])){ echo "<div class=\\"error\\ ">Error accessing the MySQL database. Re-check database information. :[</div>"; } ?> <div class="box"> <form action="index_4.php" method="post"> Database Host <br /> <span style="font-size:11px;">Commonly localhost, external MySQL servers may differ.</span> <div class="clear"></div> <input type="text" name="host" size="40" value="localhost"> <br /> <br />Database Username <br /> <span style="font-size:11px;">The username you configured for your MySQL database.</span> <div class="clear"></div> <input type="text" name="user" size="40"> <br /> <br />Database Password <br /> <span style="font-size:11px;">The password you configured for your MySQL database.</span> <div class="clear"></div> <input type="text" name="pass" size="40"> <br /> <br />Database Name <br /> <span style="font-size:11px;">The name you configured for your MySQL database.</span> <div class="clear"></div> <input type="text" name="name" size="40"> <br /> <br />Password Key <br /> <span style="font-size:11px;">A unique and random key to encrypt user passwords.</span> <div class="clear"></div> <input type="text" name="pass_key" size="40"> <br /> <br /> <input type="submit" class="button" value="Continue"> </form> </div> </div> </div> <div id="footer"> <div style="float:left;"> minstaller v1.2 - Powered by: <a href='http://www.forum.net'>Bulletin Board</a> </div> <div style="float:right;"> <a href="http://www.forum.net/docs" target="_blank" style="color:#808080;">I need help!</a> </div> </div> </div> </body> </html> 

and this is my index_4.php file that goes white after index_3.php: 这是我的index_4.php文件,在index_3.php之后变成白色:

 <?php if (!file_exists( "install.txt")){ die( "Installer locked."); } ?> <?php # Database Connection if ($_POST[ "host"] !=n ull && $_POST[ "user"] !=n ull && $_POST[ "pass"] !=n ull && $_POST[ "name"] !=n ull && $_POST[ "pass_key"] !=n ull) { $mysqli=@ new mysqli($_POST[ "host"], $_POST[ "user"], $_POST[ "pass"], $_POST[ "name"]); } else { header( 'location: ./index_3.php?error=1'); exit(); } if (mysqli_connect_errno()) { header( 'location: ./index_3.php?error=1'); exit(); } else { $config_file='<?php /******************* | forum software | powered by forum 1.2 *******************/ if(!defined("access")){ include("errors/access.html"); exit(); } /******************* | The following settings are related | to the MySQL side of the application *******************/ $DB_NAME = "' . $_POST[ "name"] . '"; // Your database name $DB_HOST = "' . $_POST[ "host"] . '"; // Your database host $DB_USER = "' . $_POST[ "user"] . '"; // Your database username $DB_PASS = "' . $_POST[ "pass"] . '"; // Your database password // Please change the following key to a secure phrase - do not modify after board installation $config["password_key"] = "' . $_POST[ "pass_key"] . '"; ?> '; $write_config=f open( "../forum/db_config.php", "w"); fwrite($write_config, $config_file); fclose($write_config); } ?> <!doctype html> <html> <head> <title>forum Installer - Step 3 of 7</title> <link rel="stylesheet" type="text/css" href="css/installer.css" /> </head> <body> <div id="wrap"> <img src="images/mbbinstall_logo.png" /> <div id="container"> <div id="menu"> <a href="#" class="current"> <img src="images/green/welcome.png" alt="Y">Welcome to forum!</a> <a href="#" class="current"> <img src="images/green/percheck.png" alt="Y">Check Permissions</a> <a href="#" class="current"> <img src="images/grey/mysql.png" alt="Y">Configure MySQL</a> <a href="#"> <img src="images/grey/settings.png" alt="N">Configure Settings</a> <a href="#"> <img src="images/grey/table.png" alt="N">Install Tables</a> <a href="#"> <img src="images/grey/account.png" alt="N">Create Admin Account</a> <a href="#"> <img src="images/grey/forum.png" alt="N">Your New Forum</a> </div> <div id="content"> <div class="title">forum MySQL Configuration</div> <div class="title2">Step 3 of 7</div> <div class="box2"> forum has successfully connected to your MySQL database. Next we are ready to configure your board settings! Click "Configure Settings" to begin your board configuration. <br /> <br /> </div> <div style="float:right;"> <a href="index_5.php" class="button">Configure Settings</a> </div> </div> </div> <div id="footer"> <div style="float:left;"> forum installer v1.2 - Powered by: <a href='https://forum.net'>forum Bulletin Board</a> </div> <div style="float:right;"> <a href="https://forum.net/docs.html" target="_blank" style="color:#808080;"> I need help!</a> </div> </div> </body> </html> 

I don't know how your code can work in your development environment. 我不知道您的代码如何在您的开发环境中工作。 There is a PHP syntax error: PHP语法错误:

'; $write_config=f open( "../forum/db_config.php", "w"); fwrite($write_config, $config_file); fclose($write_config); } ?>

Must be 一定是

'; $write_config=fopen( "../forum/db_config.php", "w"); fwrite($write_config, $config_file); fclose($write_config); } ?>

(No space between "f" en "open") (“ f”和“ open”之间没有空格)

Anyway: If you want to debug such an error make sure error_reporting has been set E_ALL. 无论如何:如果要调试此类错误,请确保已将error_reporting设置为E_ALL。 You may also want to check your server error-logs. 您可能还需要检查服务器错误日志。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我的 Laravel 5.5 应用程序在部署后无法在远程服务器 namecheap VPS 上运行,但在使用 WAMP 的本地服务器上运行良好 - My Laravel 5.5 app not working on remote server namecheap VPS after deployment but working fine on local server with WAMP header()适用于Wamp,但不适用于服务器 - header() works with wamp but not on server 适用于WAMP,但不适用于远程服务器 - Works on WAMP but not on remote server getElementbyId 在服务器上返回 null 但在我的本地 wamp 上工作正常 - getElementbyId returns null on server but works fine on my local wamp PHP $ _SESSION可以在WAMP上运行,但不能在服务器上使用完全相同的代码,为什么? - PHP $_SESSION works on WAMP but not on my Server with exact same code, why? 我的SQL代码似乎没有连接到我的服务器。 它曾经做到过,并且可以在我的Wamp服务器上使用 - My SQL code doesn't seem to be connecting to my server. It used to do it and it works on my Wamp server PHPMailer可在WAMP上使用,但不能在生产服务器上使用 - PHPMailer Works on WAMP but not on Production Server WAMP服务器中未运行php脚本 - php script not running in WAMP server 注销脚本可在localhost上运行,但不能在我的托管服务器上运行 - logout script works on localhost but not on my hosted server wamp 服务器不工作但服务器在线 我的 wamp 服务器 2.4 - wamp server not work but server is online my wamp server 2.4
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM