I'm sorry if this question is considered as duplicate. I know what warning message come from but I want to know why in XAMPP (php 5.6)
this error not showing but when I deploy in Ubuntu
it show up. My development environment is in windows
but I have to deploy web in linux. thanks

- 1,235
- 2
- 18
- 43

- 1,759
- 1
- 15
- 31
-
The difference is in the configuration. Your Linux apache configuration for showing errors is not the same as the WAMP version. – Meloman Sep 14 '17 at 08:47
-
what kind of configuration? specific key item of config? – Angga Ari Wijaya Sep 14 '17 at 08:51
-
See @delboy1978uk answer. or https://stackoverflow.com/questions/1053424/how-do-i-get-php-errors-to-display – Meloman Sep 14 '17 at 08:53
-
I do `ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL);` but in windows still working as I expected. No error like in linux – Angga Ari Wijaya Sep 14 '17 at 09:01
3 Answers
This is to do with your php.ini
settings, and less to do with the environment's OS.
If you have display_errors
on in your php.ini
, then notices, warnings, errors etc will display on your page, the level of which depends on what error_reporting
is set to.
For the best error logging experience, set error_reporting to -1, turn display_errors off, and set a custom error_log. Then in the terminal, type 'tail -f /path/to/error_log'. Your notices, warnings and errors will now scroll past in real time, without distorting your web page's display.
Your error happens because you are sending the request BODY before the HEADERS! Stopping the errors displaying will stop that.
Finally, look for whitespace at the start of your files, like a space before a <?php
for example.

- 12,118
- 2
- 21
- 39
-
both windows and ubuntu show the same level of errors,, even in windows does not show the errors, it should be stop anyway like in ubuntu, but inwindows still working normally. – Angga Ari Wijaya Sep 14 '17 at 08:51
Xampp and similar software packs are bundled according to a developer's needs. If you are using a global web server, settings are high likely different to protect your server and sensitive data.
If you can download linux server's php.ini you can compare it with yours. For instance your local server's error_reporting is set to E_ALL then your linux server's ini could be different.
additionally you can check this link for best pratices

- 2,727
- 26
- 37
After some research, I found settings in php.ini output_buffering=4096
if I turn this off then in Xampp also showing error such session_start(): Cannot send session cache limiter..
like in linux, but I'm not really sure what is the use of output_buffering
actually.

- 1,759
- 1
- 15
- 31