[PHP] PHP code dissapeared / No output?

Hello.

I even asked A.I. about this issues and cannot resolve this problem
ive had since yesterday...

ive been working on a script for a week or so.. - Scheduled task /
cron job. But if i activate manually, i see output to screen.

At the end of one script, I include a new php file and activate a function..

include_once ("INS_NwSQL.php");
echo "GO TO do_new_scan()<br />\n";
flush();
    do_new_scan();
    sleep(2); // optional short delay between rounds

Everthings working fine, but the all of a sudden - my new function
will not work (no output to screen, No log files saved - just blnk -
NO HTML output at all..

On my screen, i do see the output of:- echo "GO TO do_new_scan()<br />\n";

However NOTHING after then..

Ive gone through php code validators - no errors,
ive got this in my new / second file (just immediately after the
function activates)

error_reporting(E_ALL);

$t=date("Ymd");
$path =$GLOBALS["BASEPATH"]."/logs/GB_ERROR-$t.txt";
ini_set('display_errors', 1); ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
ini_set('error_log',$path); //override php's default error log directory

has anyone got ideas as to force some output (or errors) to the screen
/ log file ?

--

Gordon.

Gordon,

On May 16, 2025, at 10:46 AM, gordonisnz@gmail.com wrote:

Everthings working fine, but the all of a sudden - my new function
will not work (no output to screen, No log files saved - just blnk -
NO HTML output at all..

Looking at the browser debugger, what is the status of the page?

Are there errors in the log?

I am wondering if there is a server error.

David

headers are Ok.

HTTP/1.1 200 OK
Date Fri, 16 May 2025 15:30:39 GMT
Content-Type text/html; charset=UTF-8
Content-Length 27
Connection keep-alive
Server Apache
X-Powered-By PHP/7.4.10

as i do see this on my screen:- GOT HERE 1 - GB_scan<br />
(thats from the 1st script - immediately before calling 2nd script...)

2nd script WAS working, as i saw results - its only since yesterday
that its bank.
- NO results on-screen (I should have 30-50KB in output)
- No errors recorded in my logs (normal output logs, and error logs -
output logs should be 50-100KB)
- not even any logs created (1 byte)

Ive checked the server logs & do see errors in another script - from 5
days ago (already fixed)
Nothing after 12th May - or regarding the script im working on.

On Sat, 17 May 2025 at 03:25, David Colter <dcolter@me.com> wrote:

Gordon,

> On May 16, 2025, at 10:46 AM, gordonisnz@gmail.com wrote:
>
> Everthings working fine, but the all of a sudden - my new function
> will not work (no output to screen, No log files saved - just blnk -
> NO HTML output at all..

Looking at the browser debugger, what is the status of the page?

Are there errors in the log?

I am wondering if there is a server error.

David

--

Gordon.

I copied the code to a backup file-name.

deleted the original file & then copied short sections of code to the
original file, test, copy, test etc..

Ive now got working code - all is Ok but still dont know why it was
blank/result...

i asked AI to compare the files & apparently there was a rogue exit
command (but this apparently didnt trigger the shutdown routine -
register_shutdown_function('shutdownINS_MYSQL') )

(Wonder why AI didnt find the rogue exit before :slight_smile: )

--

Gordon.

Hi Gordon,

Hope you are well …

It’s just a hunch from having been bitten by empty responses in Apache/PHP scripts before … In my experience, any whitespace outside of PHP code is treated as the beginning of HTML output and so it will interrupt execution of PHP further down …

I may be reading incorrectly but could there be a space character before the include_once()? (Or perhaps diffing against the most recent working copy for any whitespace changes will reveal something …)

Hope you find a solution soon :folded_hands:
Patty

On Fri, May 16, 2025 at 8:51 AM <gordonisnz@gmail.com> wrote:

headers are Ok.

HTTP/1.1 200 OK
Date Fri, 16 May 2025 15:30:39 GMT
Content-Type text/html; charset=UTF-8
Content-Length 27
Connection keep-alive
Server Apache
X-Powered-By PHP/7.4.10

as i do see this on my screen:- GOT HERE 1 - GB_scan

(thats from the 1st script - immediately before calling 2nd script…)

2nd script WAS working, as i saw results - its only since yesterday
that its bank.

  • NO results on-screen (I should have 30-50KB in output)
  • No errors recorded in my logs (normal output logs, and error logs -
    output logs should be 50-100KB)
  • not even any logs created (1 byte)

Ive checked the server logs & do see errors in another script - from 5
days ago (already fixed)
Nothing after 12th May - or regarding the script im working on.

On Sat, 17 May 2025 at 03:25, David Colter <dcolter@me.com> wrote:

Gordon,

On May 16, 2025, at 10:46 AM, gordonisnz@gmail.com wrote:

Everthings working fine, but the all of a sudden - my new function
will not work (no output to screen, No log files saved - just blnk -
NO HTML output at all..

Looking at the browser debugger, what is the status of the page?

Are there errors in the log?

I am wondering if there is a server error.

David

Gordon.

I solved my issue a few days ago (I thought I replied to this thread..)

i dont know what the problem was, but basically.
- renamed old code (problem) to (name).bak.php - backup file..

did a new file of original name - copy/pasting the routines one at a
time.. & the 'new' script worked...

dont know why original one didn't

G.
---------- Forwarded message ---------
From: Patty Aguayo <patty@aguayofamily.org>
Date: Tue, 20 May 2025 at 10:22

Hi Gordon,

Hope you are well ...

It's just a hunch from having been bitten by empty responses in
Apache/PHP scripts before ... In my experience, any whitespace outside
of PHP code is treated as the beginning of HTML output and so it will
interrupt execution of PHP further down ...

--

Gordon.