Title: autotutorial's Replies - page 8 | WordPress.org

---

# autotutorial

  [  ](https://wordpress.org/support/users/autotutorial/)

 *   [Profile](https://wordpress.org/support/users/autotutorial/)
 *   [Topics Started](https://wordpress.org/support/users/autotutorial/topics/)
 *   [Replies Created](https://wordpress.org/support/users/autotutorial/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/autotutorial/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/autotutorial/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/autotutorial/engagements/)
 *   [Favorites](https://wordpress.org/support/users/autotutorial/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 106 through 120 (of 706 total)

[←](https://wordpress.org/support/users/autotutorial/replies/page/7/?output_format=md)
[1](https://wordpress.org/support/users/autotutorial/replies/?output_format=md) 
[2](https://wordpress.org/support/users/autotutorial/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/autotutorial/replies/page/3/?output_format=md)…
[7](https://wordpress.org/support/users/autotutorial/replies/page/7/?output_format=md)
8 [9](https://wordpress.org/support/users/autotutorial/replies/page/9/?output_format=md)…
[46](https://wordpress.org/support/users/autotutorial/replies/page/46/?output_format=md)
[47](https://wordpress.org/support/users/autotutorial/replies/page/47/?output_format=md)
[48](https://wordpress.org/support/users/autotutorial/replies/page/48/?output_format=md)
[→](https://wordpress.org/support/users/autotutorial/replies/page/9/?output_format=md)

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [PHP 7.3 Warning in php_errorlog](https://wordpress.org/support/topic/php-7-3-warning-in-php_errorlog/)
 *  [autotutorial](https://wordpress.org/support/users/autotutorial/)
 * (@autotutorial)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/php-7-3-warning-in-php_errorlog/#post-12284833)
 * means fopen returns false because the file does not exist or does not have read
   permissions.
    in my opinion it is not a bug but an incorrect configuration of
   the web server for theme or plugins.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Link opens a directory on my server](https://wordpress.org/support/topic/link-opens-a-directory-on-my-server/)
 *  [autotutorial](https://wordpress.org/support/users/autotutorial/)
 * (@autotutorial)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/link-opens-a-directory-on-my-server/#post-12282462)
 * Disable Directorylisting [https://www.thesitewizard.com/apache/prevent-directory-listing-htaccess.shtml](https://www.thesitewizard.com/apache/prevent-directory-listing-htaccess.shtml)
   
   Enable Directoryindex [http://www.htaccess-guide.com/directoryindex-uses/](http://www.htaccess-guide.com/directoryindex-uses/)
   Currently you cannot use files, folders that actually exists outside the context
   of WordPress, you have to delete the existing folder or file and WordPress when
   it is not a regular file or it is not a directory thinks it is a slug of the 
   path.
 *   Forum: [Installing WordPress](https://wordpress.org/support/forum/installation/)
   
   In reply to: [trouble with mySQL 8 in IIS Windows Server 2016](https://wordpress.org/support/topic/mysql-8-in-iis-window-server-needed/)
 *  [autotutorial](https://wordpress.org/support/users/autotutorial/)
 * (@autotutorial)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/mysql-8-in-iis-window-server-needed/#post-12281107)
 * Hi [@sterndata](https://wordpress.org/support/users/sterndata/) update post.
 *   Forum: [Installing WordPress](https://wordpress.org/support/forum/installation/)
   
   In reply to: [trouble with mySQL 8 in IIS Windows Server 2016](https://wordpress.org/support/topic/mysql-8-in-iis-window-server-needed/)
 *  [autotutorial](https://wordpress.org/support/users/autotutorial/)
 * (@autotutorial)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/mysql-8-in-iis-window-server-needed/#post-12281063)
 * > To connect to the server following data directory initialization, you must 
   > therefore use a client or connector that supports caching_sha2_password. If
   > you can do this but prefer that the not_user_root account use mysql_native_password
   > after installation, install MySQL and initialize the data directory as you 
   > normally would. Then connect to the server as root and use ALTER USER as follows
   > to change the account authentication plugin and password:
 *     ```
       ALTER USER 'not_user_root'@'localhost'
         IDENTIFIED WITH mysql_native_password
         BY 'password';
       ```
   
 * > If the client or connector that you use does not yet support caching_sha2_password,
   > you can use a modified data directory-initialization procedure that associates
   > the not_user_root account with mysql_native_password as soon as the account
   > is created. To do so, use either of these techniques:
   > Supply a –default-authentication-plugin=mysql_native_password option along 
   > with –initialize or –initialize-insecure.
   > Set default_authentication_plugin to mysql_native_password in an option file,
   > and name that option file using a –defaults-file option along with –initialize
   > or –initialize-insecure. (In this case, if you continue to use that option 
   > file for subsequent server startups, new accounts will be created with mysql_native_password
   > rather than caching_sha2_password unless you remove the default_authentication_plugin
   > setting from the option file.)
 * [https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password](https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password)
 * (WordPress 5.3 have support for php 7.4) From php 7.4 **MYSQL Native Driver**(
   MYSQLND) there should be support for the connector, also with caching_sha2_password
   
   [https://github.com/php/php-src/commit/4f06e67ad2201390ed35a9ea6288a00c0b04782b#commitcomment-32356655](https://github.com/php/php-src/commit/4f06e67ad2201390ed35a9ea6288a00c0b04782b#commitcomment-32356655)
 * For plug-in PAM [https://wordpress.org/support/topic/mariadb-authentication-does-not-work-when-mariadb-is-integrated-with-pamldap/](https://wordpress.org/support/topic/mariadb-authentication-does-not-work-when-mariadb-is-integrated-with-pamldap/)
    -  This reply was modified 6 years, 4 months ago by [autotutorial](https://wordpress.org/support/users/autotutorial/).
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [generated unexpected PHP debug output](https://wordpress.org/support/topic/generated-unexpected-php-debug-output/)
 *  [autotutorial](https://wordpress.org/support/users/autotutorial/)
 * (@autotutorial)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/generated-unexpected-php-debug-output/#post-12270796)
 * that type of constants can be created anywhere, you have to check if they are
   not defined you have to create them.
    In this case it is a bug of your theme,
   ask for support to your theme in order to improve the code forever or use a theme
   that doesn’t have this bug. If defined
 *     ```
       if ( defined( 'ANY_CONSTANT' ) ) {
       //Code
       }
       ```
   
 * If not defined
 *     ```
       if ( ! defined( 'ANY_CONSTANT' ) ) {
       define( 'ANY_CONSTANT', 'my_value' );
       }
       ```
   
 * if the error is a wrong coding of your theme you can solve it only by removing
   the constants involved inside your wp-config.php
    -  This reply was modified 6 years, 4 months ago by [autotutorial](https://wordpress.org/support/users/autotutorial/).
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Uploaded Image Blank](https://wordpress.org/support/topic/uploaded-image-blank/)
 *  [autotutorial](https://wordpress.org/support/users/autotutorial/)
 * (@autotutorial)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/uploaded-image-blank/#post-12270051)
 * the path of the attachments is stored in your database (the actual content resides
   in the uploads directory), then be seen in the multimedia library.
    Enable debugging
   I hope this helps. Do not hesitate to write in case of problems. [https://wordpress.org/support/topic/no-results-in-media-search/](https://wordpress.org/support/topic/no-results-in-media-search/)
   some configurations require 775 from the parent folder to the daughter folder
   and 664 files. But if you set 777 from the parent folder to the 777 daughter 
   and file folder and it appears in the media library, it means you have permission
   issues (owner of the file, wrong permissions or both). Setting to 777 is only
   useful for debugging, leaving this forever exposes you to security risks. install
   the healt check plugin and in troubleshooting view file system permissions … 
   it should say writable uploads folder.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [‘Your site does not have a default theme’](https://wordpress.org/support/topic/your-site-does-not-have-a-default-theme-3/)
 *  [autotutorial](https://wordpress.org/support/users/autotutorial/)
 * (@autotutorial)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/your-site-does-not-have-a-default-theme-3/#post-12269906)
 * the default theme value is defined by this constant and if you started with WordPress
   5.1 it is this.
    `define( 'WP_DEFAULT_THEME', 'twentynineteen' );` all predefined
   themes begin with twenty and can end with any name. Reference (fallback theme)
   [https://github.com/WordPress/WordPress/blob/5.1-branch/wp-includes/default-constants.php#L395](https://github.com/WordPress/WordPress/blob/5.1-branch/wp-includes/default-constants.php#L395)
   Check your local /wp-includes/default-constants.php file, to be aware of which
   default theme you started.
 * Reference (all default themes ) [https://github.com/WordPress/WordPress/blob/5.1-branch/wp-includes/class-wp-theme.php#L45](https://github.com/WordPress/WordPress/blob/5.1-branch/wp-includes/class-wp-theme.php#L45)
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [WP on Virtual Host – Just home page works, every other link return error 500](https://wordpress.org/support/topic/wp-on-virtual-host-just-home-page-works-every-other-link-return-error-500/)
 *  [autotutorial](https://wordpress.org/support/users/autotutorial/)
 * (@autotutorial)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/wp-on-virtual-host-just-home-page-works-every-other-link-return-error-500/#post-12269312)
 * Rewrite url for nginnx [https://wordpress.org/support/article/nginx/](https://wordpress.org/support/article/nginx/)
   
   Your installation is currently in the astronomia directory.
 *     ```
       # BEGIN WordPress
   
       <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteBase /astronomia/
       RewriteRule ^astronomia/(index\.php)?$ – [L]
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule . /astronomia/index.php [L]
       #RewriteRule ^(.+)$ /astronomia/index.php/$1 [L,QSA]
       #RewriteRule !^addnew/ addnew%{REQUEST_URI}
       </IfModule>
   
       # END WordPress
       ```
   
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Replacement for current_time( ‘timestamp’ )](https://wordpress.org/support/topic/replacement-for-current_time-timestamp/)
 *  [autotutorial](https://wordpress.org/support/users/autotutorial/)
 * (@autotutorial)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/replacement-for-current_time-timestamp/page/2/#post-12269253)
 * I’ll explain, you can’t use a time zone on the DateTime object example
 *     ```
       // Bad for DateTime
       $object = new DateTime( '@' . 10000000, new DateTimeZone( 'Europe/Rome' ) );
       ```
   
 * if the date has a timestamp (UTC) or a time zone expressed on the date.
    You 
   can always use `$object->setTimezone(new DateTimeZone('Europe/Rome'));` regardless
   if you have an input with timestamp or time zone .. setTimezone is used exactly
   to set the timezone and cannot produce an error.
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Replacement for current_time( ‘timestamp’ )](https://wordpress.org/support/topic/replacement-for-current_time-timestamp/)
 *  [autotutorial](https://wordpress.org/support/users/autotutorial/)
 * (@autotutorial)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/replacement-for-current_time-timestamp/page/2/#post-12268534)
 * Sorry
    replace `$localtime = $var->getTimestamp()+$var->getOffset();` with `$
   localtime = $var->getTimestamp()` 23:00 UTC it’s correct, use timezone for consversion
   Europe/Rome 00:00 🙂 (convert local to UTC with this timezone `$object->setTimezone(
   new DateTimeZone( 'UTC' ) );` ).
 *     ```
       $array = current_datetime();
       $var = $array->setTime( 0, 0, 0, 0); // Work for version PHP 7.1 or above
   
       $timestamp = $var->getTimestamp();
       $my_date = new DateTime( '@' . $timestamp );
       $my_date->setTimezone( new DateTimeZone( 'UTC' ) ); //23:00 UTC correct
   
       //local time
       $timezone = $var->getTimezone(); //Europe/Rome offset +01:00
       $my_date2 = new DateTime( '@' . $timestamp );
       $my_date2->setTimezone( $timezone ); //00:00 Europe/Rome correct
   
       //Local time show UTC, never use it
       $new_timestamp = $timestamp+$var->getOffset();
       $my_date3 = new DateTime( '@' . $new_timestamp )
       $my_date3->setTimezone( new DateTimeZone( 'UTC' ) ); //00:00 correct conversion from local to UTC
       ```
   
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Replacement for current_time( ‘timestamp’ )](https://wordpress.org/support/topic/replacement-for-current_time-timestamp/)
 *  [autotutorial](https://wordpress.org/support/users/autotutorial/)
 * (@autotutorial)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/replacement-for-current_time-timestamp/page/2/#post-12268495)
 *     ```
       function current_datetime() {
           return new DateTimeImmutable( 'now', wp_timezone() );
       }
       ```
   
 * You can’t use DateTime functions for DateTimeImmutable, look at the first option
   of my code 🙂
    DateTimeImmutable [https://www.php.net/manual/en/datetimeimmutable.settime.php](https://www.php.net/manual/en/datetimeimmutable.settime.php)
   do not modify DateTimeImmutable, convert it to DateTime. `getTimestamp()` should
   be used after setting midnight `$object->getTimestamp();` DateTime::getTimestamp
   DateTimeImmutable::getTimestamp DateTimeInterface::getTimestamp date_timestamp_get
 * Learn to use DateTime, at the moment you cannot manage DateTimeImmutable, this
   code is only here for completeness.
 *     ```
       $array = current_datetime();
       $var = $array->setTime( 0, 0, 0, 0); // Work for version PHP 7.1 or above
       $localtime = $var->getTimestamp()+$var->getOffset();
       echo $localtime;
       ```
   
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Replacement for current_time( ‘timestamp’ )](https://wordpress.org/support/topic/replacement-for-current_time-timestamp/)
 *  [autotutorial](https://wordpress.org/support/users/autotutorial/)
 * (@autotutorial)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/replacement-for-current_time-timestamp/page/2/#post-12268218)
 * [https://www.php.net/manual/en/function.date-default-timezone-set.php](https://www.php.net/manual/en/function.date-default-timezone-set.php)
   
   date-default-timezone-set and [https://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone](https://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone)
   date.timezone I can set a time zone, WordPress for over 10 years has been using
   default UTC, you can later select your time zone (timezone string or offset number)
   in the dashboard, the old php functions if they have a timezone other than UTC
   they produce a timestamp for that timezone while `$array->getTimestamp()` is 
   the from UTC. Since you use an explicit timezone in DateTime your local time 
   is always the correct one, it should also be remembered that Europe/Rome 2020-
   03-29 02:00:00 with the time zone Europe/Rome shows 2020-03-29 03:00: 00 Daylight
   saving time is in use (the timestamp is always UTC, the output for Daylight saving
   time changes). since current_time before WordPress 5.3 calculated a WP offset(
   he took UTC for granted and did the sum with the offset in the dashboard). As
   of WordPress 5.3 it is safe (now WordPress use DateTime class). Since in the 
   past it has been used incorrectly it is right to remove current_time and use 
   current_datetime.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Media Library permission checks](https://wordpress.org/support/topic/media-library-permission-checks/)
 *  [autotutorial](https://wordpress.org/support/users/autotutorial/)
 * (@autotutorial)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/media-library-permission-checks/#post-12267760)
 * install the health check plugin, go to permissions and then file system. /home/
   user/wp-content/uploads/ … current directory for attachment, your temp directory/
   home/user/temp/ or /home/.dummy/user/ etc.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Media Library permission checks](https://wordpress.org/support/topic/media-library-permission-checks/)
 *  [autotutorial](https://wordpress.org/support/users/autotutorial/)
 * (@autotutorial)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/media-library-permission-checks/#post-12267631)
 * in normal conditions the temporary folder should delete the files at the end 
   of the code (for this reason a temporary folder is used otherwise the problem
   lies in the server but WordPress should understand if you have such a defect),
   what error does it tell you?
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Can’t upload .xml file](https://wordpress.org/support/topic/cant-upload-xml-file/)
 *  [autotutorial](https://wordpress.org/support/users/autotutorial/)
 * (@autotutorial)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/cant-upload-xml-file/#post-12267607)
 * Enable debugging WordPress or error logging on your server, make sure the xml
   file is well formed before importing.
    which plugin are you using for import?

Viewing 15 replies - 106 through 120 (of 706 total)

[←](https://wordpress.org/support/users/autotutorial/replies/page/7/?output_format=md)
[1](https://wordpress.org/support/users/autotutorial/replies/?output_format=md) 
[2](https://wordpress.org/support/users/autotutorial/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/autotutorial/replies/page/3/?output_format=md)…
[7](https://wordpress.org/support/users/autotutorial/replies/page/7/?output_format=md)
8 [9](https://wordpress.org/support/users/autotutorial/replies/page/9/?output_format=md)…
[46](https://wordpress.org/support/users/autotutorial/replies/page/46/?output_format=md)
[47](https://wordpress.org/support/users/autotutorial/replies/page/47/?output_format=md)
[48](https://wordpress.org/support/users/autotutorial/replies/page/48/?output_format=md)
[→](https://wordpress.org/support/users/autotutorial/replies/page/9/?output_format=md)