簡體   English   中英

腳本可以在Wamp服務器上運行,但不能在我的VPS上運行

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

好吧,所以我正在做一個論壇項目,遇到了麻煩。 將我所有的文件上傳到wamp中,並開始安裝過程,一切正常。 但是,當我將相同文件上傳到我的實時網站(使用whm和cpanel)時,我會經歷安裝過程,當我進入index_3.php並鍵入所有服務器信息時,我單擊繼續並出現白屏,沒有錯誤。 我檢查了php.ini並打開了顯示錯誤,什么也沒有。 檢查了cpanel錯誤日志,什么都沒有...

我的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> 

這是我的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> 

我不知道您的代碼如何在您的開發環境中工作。 PHP語法錯誤:

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

一定是

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

(“ f”和“ open”之間沒有空格)

無論如何:如果要調試此類錯誤,請確保已將error_reporting設置為E_ALL。 您可能還需要檢查服務器錯誤日志。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM