Hi all

PHP Noob here.

Does anyone know what differences could exist between a live webserver and my production environment to cause a function to work online, but fail locally?

I have taken over a project and one of the functions that is used on every page is defined thusly:

public function getFooter($extras){
//etc
}

Wherever the function is called, it is called like this:

<?php echo $header->getFooter(); ?>

Now, when I run this locally, I get the expected PHP error that the method is missing an input parameter. However, this same code seems to run fine online. Any ideas why? Could it be a difference in PHP version? OS version? Something like "on error resume next" turned on for the webserver? I don't get it.

I can fix this easily by putting an empty string '' into the method calls, but I hesitate to change something that appears to be working online.

Any advice is appreciated.

    Public webservers generally have display_errors = off in php.ini as a security precaution. It's not working, just not complaining about it.

      Furthermore, production environemnts should instead be logging errors. Check if PHP is configured to dump errors into an error log.

        Write a Reply...