0

I know there's many questions like this, tried many but without solution. Maybe it's impossible, but i try to ask. I'm moving our old win 2003/apache 2.0.81/php 5.1.6 internal server to a new ubuntu 20.04 / apache 2.4.41 / php 7.4.3 server.

I'd like (in developing) have error displayed in browser, and not the HTTP ERROR 500!! Just like the old server do! Take this little script:

<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
echo "ciao"
echo "ciao"
echo "ciao"
echo "ciao"
?>

Running in the old server i have this response:

Parse error: parse error, unexpected T_ECHO, expecting ',' or ';' in D:\www\progettoru_php\ciao.php on line 7

While in the new server i have the HTTP ERROR 500, of course in the server log i can see

[Fri Jun 17 13:10:16.485612 2022] [php7:error] [pid 1718] [client 172.16.0.222:14657] PHP Parse error: syntax error, unexpected 'echo' (T_ECHO), expecting ';' or ',' in /dati/intranet/helpdesk/ciao.php on line 7

But it's annoying to switch between the client and the server... any TRUE solution? Thankyou Marco

3
  • 5
    The file cannot be executed due to the parse errors, so the ini_set lines never actually affect anything. If you changed the settings in the php.ini, it would show the way you want. Commented Jun 17, 2022 at 11:20
  • 2
    "Running in the old server i have this response:" - but not because of those ini_set lines ... Commented Jun 17, 2022 at 11:23
  • YES! the solution is putting in php.ini all this settings! Thankyou CBroe Commented Jun 17, 2022 at 11:51

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.