This topic is locked

Plausibility check works locally, but not on the provider's server

1/24/2023 7:23:21 AM
PHPRunner General questions
Karlo_from_Germany author

Hallo all and greetings from Germany!

I am using PHP Runner 10.9 and for development locally Xampp 8.0.25. In my application I want to check if the date for an entry is earlier than the date of the corresponding root entry.
For this I use the following script in the area "before record added / before record updatet":

if (toPHPTime($values["datum"]) > toPHPTime($values["toern.startdatum"]))
{
$message = "Start date can not be later than End date.";
return false;
}
else
{
return true;
}

In the local view, after saving, everything works perfectly, I get, if the date is before the date in the root entry, the provided error message.
If I then upload the finished application via FTP to my provider's server (IONOS in Germany), the check no longer works, the scrip is obviously not executed. On any other web server on the local network (Synology NAS) everything works fine.

How can I solve this problem?

admin 1/24/2023

How do you know that the script is not executed?

Karlo_from_Germany author 1/24/2023

Sorry, a valid question. I actually don't know if the script is running or not. I can only say, that when I enter the same date in a field in my development environment, I get the expected error message. In the production system on the webserver I do not.

admin 1/24/2023

You need to make sure that event actually runs. You need to print values of variables like $values["datum"] and toPHPTime($values["datum"]) to see if it is converted properly to time values etc. This is something that you cannot guess, you need to understand what exactly is happening there.

fhumanes 1/24/2023

Hello,

You can activate a very simple debug system following the instructions of this article.

https://fhumanes.com/blog/guias-desarrollo/guia-34-metodo-basico-para-depuracion-codigo/

With this system you can evaluate the variable content or whether or not it passes through the program.

When you no longer want to purify code, you can deactivate it from a single point.

I hope and wish that this method serves to find the problem you have in your code.

Regards,
fernando

Karlo_from_Germany author 1/24/2023

Thanks for the ideas and tips. I have passed the problem on to my provider's server department. It seems that the problem is there.