«

»

Feb 23

Howto set timezone in php.ini with Plesk

Plesk is one of the most used web administration system , but like anyone else it’s not so easy to understand how it works. Some CMS or softwares need a properly configured timezone in php to work. To set timezone in PHP you need to write some code into parsed php.ini. But which one php.ini file is parsed ?

The phpinfo() function

Answer to this question is a line of code long: just execute a php file into your system simply declaring phpinfo() function. Example:

  • Create a test.php file
  • Write into :
    <?php
    phpinfo();
    ?>
  • Execute http://mydomain/test.php
  • Look inside the field “Loaded Configuration File”

PHP.INI

In Plesk environment the default file is in /var/www/vhosts/mydomain/etc/php.ini . This is valid also for subdomain , so we have :

  • for domain test.com : /var/www/vhosts/test.com/etc/php.ini
  • for subdomain sub.test.com : /var/www/vhosts/sub.test.com/etc/php.ini
Now open with an editor the php.ini file ( nano editor could be a good choice ) and write :
date.timezone = “US/Central”
Save and done! You don’t need to restart web server.
To see allowed timezones visit the official PHP page. 

 


9 comments

Skip to comment form

  1. best 1

    Hey! Do you know if they make any plugins to safeguard against
    hackers? I’m kinda paranoid about losing everything I’ve worked hard on.
    Any suggestions?

    1. Gabriele
      Gabriele

      Yes there is something, check it out

  2. Click Here

    Thanks a ton for sharing this very good website.

  3. dundee web designer

    We’re a group of volunteers and opening a new scheme in our community.

    Your website provided us with valuable info to
    work on. You have done a formidable job and our entire community will be grateful to you.

  4. Anonymous

    You’ve made some really good points there. I looked on the web to
    find out more about the issue and found most people will go along with your views
    on this web site.

  5. Megapolis Hack

    Si quelques-uns un
    wants vue expert about courant un blog après que qui je advise lui/elle à va un visite ce webpage, maintenir
    les articles de Magnificent de job. d’en haut|salut de Hello d’en haut|salut
    de j’aimerais découvrir plus ? Je fais want pour découvrir plus les informations supplémentaires de détaille de
    le Bon jour ! Est-ce que ça vous ennuierait si je partage votre blog avec mon myspace groupe ?

    Il y a beaucoup de les gens que je pense fais vraiment apprécie
    votre contenu. S’il vous plaît me permettre de
    savoir. beaucoup de merci

  6. quick design changes

    I every timme emaiiled this web site post page to all my associates, as if like to read it next my contacts will
    too.

  7. Anonymous

    I used to be recommended this blog by my cousin. I am no longer
    positive whether this put up is written via him as no one else
    recognise such detailed approximately my problem. You are amazing!
    Thanks!

  8. Marque de Voiture : Toutes les marques de voitures

    Hurrah, that’s what I was looking for, what a information! present here at
    this webpage, thanks admin of this site.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>