Re: Upgraded PHP version from 5.3 to 7.0.33 now database functions are broken...

[email protected] (Bo Berglund)
Newsgroups php.general
Message-ID <[email protected]>
On Fri, 10 Sep 2021 22:18:09 +0100, AllenJB <[email protected]> wrote:

>> Could the same be the cause here regarding the following include:
>>
>> include ($_SERVER["DOCUMENT_ROOT"] . '/php/appdbdata.php');
>>
>> It is present in each of the function related php files and uses the construct
>> above to make sure the correct file is included no matter where the using php
>> file is located.
>>
>> But do I always need include_once with PHP 7?
>
>The behavior of include_once itself hasn't changed between PHP 5.3 and 7 
>as far as I recall. Most likely it's another issue that you need to fix, 
>rather than swapping out include for include_once, which could itself 
>break code if the file is supposed to be included multiple times.
>

SOLVED!

I located ALL of the php files on the server, which were involved in the
operations triggered by the Windows management application and looked over them.
In all of them I changed the line:

include ($_SERVER["DOCUMENT_ROOT"] . '/php/appdbdata.php');

to read like this instead:

include_once ( 'appdbdata.php');

And lo-and-behold!
Now the website update command from the Windows application worked and
successfully created the needed website data!

So it is not about the mysql functions at all, but instead the way the include
is formulated. I think the reason for it to look like it did was to be able to
run these php scripts from any website directory...
But they all reside in the php dir so there is no need for a path in the
include, really.

-- 
Bo Berglund
Developer in Sweden
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.