2016-12-23 50 views
0

我在我的vps中有一個PHP頁面,它需要46個$ _POST變量。
每當我嘗試解決它,它會返回一個500內部服務器錯誤響應。
當我從文件中刪除8+ $ _POST變量時,一切都按預期工作。
我已經嘗試將max_input_vars設置爲3000,php.ini(之後重新啓動服務器)。
我也嘗試更改.htaccess文件,沒有任何工作。
有什麼建議嗎?
在此先感謝。

編輯:
錯誤日誌:

[Fri Dec 23 17:51:22.902648 2016] [:error] [pid 27211] [client 77.138.82.103:54270] PHP Parse error: syntax error, unexpected '$Phase_3_Q_Before' (T_VARIABLE) in /var/www/html/server/addSwitch.php on line 43 
[Fri Dec 23 17:51:24.215003 2016] [:error] [pid 27212] [client 77.138.82.103:54271] PHP Parse error: syntax error, unexpected '$Phase_3_Q_Before' (T_VARIABLE) in /var/www/html/server/addSwitch.php on line 43 
[Fri Dec 23 17:51:25.806288 2016] [:error] [pid 27213] [client 77.138.82.103:54280] PHP Parse error: syntax error, unexpected '$Phase_3_Q_Before' (T_VARIABLE) in /var/www/html/server/addSwitch.php on line 43 
[Fri Dec 23 17:51:27.587422 2016] [:error] [pid 27210] [client 77.138.82.103:54302] PHP Warning: phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /var/www/html/info.php on line 2 
[Fri Dec 23 17:51:34.500954 2016] [:error] [pid 27212] [client 77.138.82.103:54350] PHP Parse error: syntax error, unexpected '$Phase_3_Q_Before' (T_VARIABLE) in /var/www/html/server/addSwitch.php on line 43 
[Fri Dec 23 17:51:39.513983 2016] [:error] [pid 27260] [client 77.138.82.103:54351] PHP Parse error: syntax error, unexpected '$Phase_3_Q_Before' (T_VARIABLE) in /var/www/html/server/addSwitch.php on line 43 

部分代碼:

$Phase_3_U_Before = $_POST['Phase_3_U_Before']; 
$Phase_3_I_Before = $_POST['Phase_3_I_Before']; 
$Phase_3_P_Before = $_POST['Phase_3_P_Before']; 
$Phase_3_S_Before = $_POST['Phase_3_S_Before']; 
$Phase_3_Q_Before = $_POST['Phase_3_Q_Before']; 
$Phase_3_cos_Before = $_POST['Phase_3_cos_Before']; 
$Phase_3_U_After = $_POST['Phase_3_U_After']; 
$Phase_3_I_After = $_POST['Phase_3_I_After']; 
$Phase_3_P_After = $_POST['Phase_3_P_After']; 
$Phase_3_S_After = $_POST['Phase_3_S_After']; 
$Phase_3_Q_After = $_POST['Phase_3_Q_After']; 
$Phase_3_cos_After = $_POST['Phase_3_cos_After']; 
+0

有什麼錯誤訊息? – Federkun

+1

你檢查錯誤日誌嗎? – Dekel

+0

我會更關心*哪些*變量正在被刪除以及它們如何被使用,而不是你刪除了多少。我懷疑我們需要更多的信息來幫助這裏。對於初學者來說,導致你認爲問題與變量數量有關的原因是什麼?有沒有錯誤信息? – HPierce

回答

0

你增加了上傳大小?

upload_max_filesize = 10M 
post_max_size = 10M 

您是否檢查錯誤?

display_errors = 1 
display_startup_errors = 1 
error_reporting = E_ALL 

(所有這些添加到您的php.ini)

+0

默認情況下,upload_max_filesize和post_max_size分別爲500M。 –

+0

的display_errors = 1個 display_startup_errors = 1 的error_reporting = E_ALL 我給自己定的所有3,它並沒有給我更多的信息比以前.. –

+0

@NadavPeled比你的php.ini被overrided別處。如果你得到錯誤500,這意味着PHP不顯示錯誤。這可能是你的問題,因爲也許你在php.ini中的所有修改都是徒勞的。運行'phpinfo()'來查看加載的配置。 –