No return when application goes to server

Asked

Viewed 37 times

0

I am calling the following functions to pick up the current date and year:

$mes = date("m");
$ano = date("Y");

It works when I’m in localhost, however, when I upload the application to the server I don’t get any information of these methods. I am using PHP 5.3.

Any suggestions on how to make this information appear?

  • What have you tried?

  • Yes, add these lines at the beginning of the file, ini_set('display_errors', true); error_reporting(E_ALL); and see if there are any errors. It may be the case that Timezone is not set. Take a look at some php materials in wiki and be sure to see the tour

  • Other than that I haven’t tried anything else, because in locallhost everything appears correctly. I’m new to PHP, so I don’t have much idea what’s going on.

  • Is it just that code that trouble? There’s nothing else?

  • That’s right. I’ll check the Timezone.

  • Is there an error? put (edit) it in the question

  • @James_evans do you have just one simple PHP file with just these two calls or do you have more stuff? Are PHP versions of your machine and server the same? Or at least compatible? Apache server is running OK?

  • It doesn’t show up. Well, I’ve set up Timezone and I’ll upload the application to the server and see if something pops up, because on localhost everything is ok.

  • localhost uses the same version of php as the production host?

  • @rray, in production PHP is 5.3 and in development is 5.5

  • The code you have in question is the same code that is giving problem in the production host or has more?

  • @rray, it’s the same code.

  • wtf? , could be problem in installing php on the production host, very strange this

  • Yeah... I’ll wait for the support staff to put the system into production to see what happens. Thanks for the help!

Show 9 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.