Title: autotutorial's Replies - page 33 | 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 - 481 through 495 (of 706 total)

[←](https://wordpress.org/support/users/autotutorial/replies/page/32/?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)…
[32](https://wordpress.org/support/users/autotutorial/replies/page/32/?output_format=md)
33 [34](https://wordpress.org/support/users/autotutorial/replies/page/34/?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/34/?output_format=md)

 *   Forum: [Installing WordPress](https://wordpress.org/support/forum/installation/)
   
   In reply to: [Error establishing database connection – how to proceed now](https://wordpress.org/support/topic/error-establishing-database-connection-how-to-proceed-now/)
 *  [autotutorial](https://wordpress.org/support/users/autotutorial/)
 * (@autotutorial)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/error-establishing-database-connection-how-to-proceed-now/#post-11626638)
 * Sorry the code is not correct.
    You simply need to replace mysqli_error($link)
   with mysqli_connect_error() for the connection error. This code
 *     ```
       USE yourdatabase;
       SHOW GLOBAL VARIABLES LIKE 'PORT';
       ```
   
 * And
 *     ```
       USE yourdatabase;
       SHOW GRANTS FOR CURRENT_USER;
       ```
   
 * the first code shows the global port number, while the second shows your privileges
   for the user who made the connection.
    It’s a sql you can run it in phpmyadmin,
   mysql etc. You need to replace the name yourdatabase with the name database you
   use for WordPress.
 * Note* make sure the database WordPress user is created with local not with `any
   host`.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Update requires more recent PHP–how?](https://wordpress.org/support/topic/update-requires-more-recent-php-how/)
 *  [autotutorial](https://wordpress.org/support/users/autotutorial/)
 * (@autotutorial)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/update-requires-more-recent-php-how/#post-11624361)
 * For WordPress CORE from 5.2 minimal versione of PHP 5.6.20 and for WordPress 
   CORE 5.1.1 minimal versione of PHP 5.2.4 with Warning update your PHP.
 *   Forum: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
   
   In reply to: [Redirecting to secondary site](https://wordpress.org/support/topic/redirecting-to-secondary-site/)
 *  [autotutorial](https://wordpress.org/support/users/autotutorial/)
 * (@autotutorial)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/redirecting-to-secondary-site/#post-11624166)
 * > [Multisite Network Administration](https://wordpress.org/support/article/multisite-network-administration/)
 * > While permalinks will continue to work, the main site (i.e. the first one created)
   > will have an extra entry of blog, making your URLs appear like domain.com/blog/
   > YYYY/MM/POSTNAME.
   > This is by design, in order to prevent collisions with SubFolder installs. 
   > Currently there is no easy way to change it, as doing so prevents WordPress
   > from auto-detecting collisions between your main site and any subsites. This
   > will be addressed, and customizable, in a future version of WordPress.
   > Also note that the blog prefix is not used for static pages which will be accessible
   > directly under the base address, e.g. domain.com/PAGENAME. If you try to create
   > a static page in the first site with the name of another existing site on the
   > network, the page’s permalink will get a suffix (e.g. domain.com/PAGENAME-2).
   > If you create a new site with the slug of an existing static page, the static
   > page will not be reachable anymore. To prevent this, you can add the names 
   > of your static pages to the blacklist so that no site with that name can be
   > created.
 *   Forum: [Installing WordPress](https://wordpress.org/support/forum/installation/)
   
   In reply to: [Error establishing database connection – how to proceed now](https://wordpress.org/support/topic/error-establishing-database-connection-how-to-proceed-now/)
 *  [autotutorial](https://wordpress.org/support/users/autotutorial/)
 * (@autotutorial)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/error-establishing-database-connection-how-to-proceed-now/#post-11620882)
 * Prove this SQL
 *     ```
       USE yourdatabase;
       SHOW GLOBAL VARIABLES LIKE 'PORT';
       SHOW GRANTS FOR CURRENT_USER;
       ```
   
 * Into phpmyadmin.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Setting cron for multiple domains](https://wordpress.org/support/topic/setting-cron-for-multiple-domains/)
 *  [autotutorial](https://wordpress.org/support/users/autotutorial/)
 * (@autotutorial)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/setting-cron-for-multiple-domains/#post-11620177)
 * each configuration is different from hosting A and hosting B.
    You must follow
   the guide of your hosting. If the main domain and the subdomains are in the center
   of the language, it is absolutely your hosting will change based on the HTTP_HOST
   variable from the browser .. (it is not the only way but one of the most used).
   You need to ask your host for more information as follows: I have a wordpress
   multisite with main domain end subdomains, how can I enable cron jobs for the
   main domain and subdomains?
 * After you get this answer I write you a php code to do your tests (I want to 
   know if the hosting up is based on HTTP_HOST to distinguish the domains).
    I 
   modified the previous post with this post.
 * wp-cron.php offer three method
 *     ```
       // Use global $doing_wp_cron lock otherwise use the GET lock. If no lock, trying grabbing a new lock.
       if ( empty( $doing_wp_cron ) ) {
       	if ( empty( $_GET['doing_wp_cron'] ) ) {
       		// Called from external script/job. Try setting a lock.
       		if ( $doing_cron_transient && ( $doing_cron_transient + WP_CRON_LOCK_TIMEOUT > $gmt_time ) ) {
       			return;
       		}
       		$doing_cron_transient = $doing_wp_cron = sprintf( '%.22F', microtime( true ) );
       		set_transient( 'doing_cron', $doing_wp_cron );
       	} else {
       		$doing_wp_cron = $_GET['doing_wp_cron'];
       	}
       }
       ```
   
 * Example
    wp-cron.php with set variable $doing_wp_cron or wp-cron.php or wp-cron.
   php?doing_wp_cron=1560090633.5487570762634277343750
    -  This reply was modified 6 years, 11 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: [Setting cron for multiple domains](https://wordpress.org/support/topic/setting-cron-for-multiple-domains/)
 *  [autotutorial](https://wordpress.org/support/users/autotutorial/)
 * (@autotutorial)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/setting-cron-for-multiple-domains/#post-11620129)
 * if you disable
    `define('DISABLE_WP_CRON', true);` you have to call it manually
   via file path. [http://yourdomain.com/wp-cron.php?doing_wp_cron](http://yourdomain.com/wp-cron.php?doing_wp_cron)
   replace [http://yourdomain.com/](http://yourdomain.com/) with your domain and/
   or https.
 * a multisite installation requires that the core files are installed only once
   and if the main site and the secondary site have different domains you have to
   do what your hosting shows you.
    Some hosting services have the multisite parameter(
   or the absolute local path example /home/user/wp-cron.php?doing_wp_cron) and 
   will work in any domain and will always point to the path of the wp-cron.php?
   doing_wp_cron file.
 * note * you must have already created the file wp-config.php which will call wp-
   settings.php otherwise without file wp-config.php when you call wp-cron.php?doing_wp_cron
   which in turn calls wp-load.php will start a new installation.
    only if your 
   hosting adds the timestamp in doing_wp_cron otherwise ask them for more information.
   example doing_wp_cron=1560090633.5487570762634277343750
 *   Forum: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
   
   In reply to: [multisite non www gets redirected to main site](https://wordpress.org/support/topic/multisite-non-www-gets-redirected-to-main-site/)
 *  [autotutorial](https://wordpress.org/support/users/autotutorial/)
 * (@autotutorial)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/multisite-non-www-gets-redirected-to-main-site/#post-11618068)
 * if the request is without www but you want the redirect for both domains.
 *     ```
       RewriteCond %{HTTP_HOST} !^www\. [NC]
       RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
       ```
   
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [CORS Blocking Issue](https://wordpress.org/support/topic/cors-blocking-issue/)
 *  [autotutorial](https://wordpress.org/support/users/autotutorial/)
 * (@autotutorial)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/cors-blocking-issue/#post-11616270)
 * Use this for SiteB
    `Access-Control-Allow-Origin: *` or `Access-Control-Allow-
   Origin: http://siteA.com/` ?
 *   Forum: [Installing WordPress](https://wordpress.org/support/forum/installation/)
   
   In reply to: [Error establishing database connection – how to proceed now](https://wordpress.org/support/topic/error-establishing-database-connection-how-to-proceed-now/)
 *  [autotutorial](https://wordpress.org/support/users/autotutorial/)
 * (@autotutorial)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/error-establishing-database-connection-how-to-proceed-now/#post-11615859)
 * Hi sorry I was not clear only you know what port to use, if you rely on your 
   hosting ask them how to access.
    If everything else is managed by you go to phpmyadmin
   click your database and then enter this sql `SHOW GLOBAL VARIABLES LIKE 'PORT';`
   If different from 3306 you have to add it as I said before
 *   Forum: [Installing WordPress](https://wordpress.org/support/forum/installation/)
   
   In reply to: [Error establishing database connection – how to proceed now](https://wordpress.org/support/topic/error-establishing-database-connection-how-to-proceed-now/)
 *  [autotutorial](https://wordpress.org/support/users/autotutorial/)
 * (@autotutorial)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/error-establishing-database-connection-how-to-proceed-now/#post-11613138)
 *     ```
       <?php
       if(function_exists('mysqli_connect')){
       if(!($link = mysqli_connect('localhost','username','password','my_db'))){
       die('could not connect: ' . mysqli_error($link));
       }
       } else {
       die("don't have mysqli");
       }
       echo 'connect successfully';
       mysqli_close($link);
       ```
   
 * try this code, create it in utf-8 change encoding in iso-8859-1 and delete anything
   that starts before
    `<?php` Use only enconding without Bom
 * Note* It may be that you need to modify the first parameter by adding the port
   localhost:8005 or change localhost with 127.0.0.1 or with the added port 127.0.0.1:
   8005 this port 8005 is an example
    -  This reply was modified 6 years, 11 months ago by [autotutorial](https://wordpress.org/support/users/autotutorial/).
      Reason: Add $link to mysqli_error function
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Custom theme being replaced with WordPress.org theme – After Update](https://wordpress.org/support/topic/custom-theme-being-replaced-with-wordpress-org-theme/)
 *  [autotutorial](https://wordpress.org/support/users/autotutorial/)
 * (@autotutorial)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/custom-theme-being-replaced-with-wordpress-org-theme/#post-11609868)
 * I can think of blocking theme updates [https://codex.wordpress.org/Editing_wp-config.php](https://codex.wordpress.org/Editing_wp-config.php),
   or after backup files and databases, set the default theme.
    [https://codex.wordpress.org/Network_Admin_Themes_Screen#Default_Theme](https://codex.wordpress.org/Network_Admin_Themes_Screen#Default_Theme)
 * Clone your Chameleon with new name add it into define function for default theme.
 *   Forum: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
   
   In reply to: [Blogs.dir in WP above 3.5](https://wordpress.org/support/topic/blogs-dir-in-wp-above-3-5/)
 *  [autotutorial](https://wordpress.org/support/users/autotutorial/)
 * (@autotutorial)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/blogs-dir-in-wp-above-3-5/#post-11609699)
 * > Your first site on a fresh install will put uploaded files in the traditional
   > location of /wp-content/uploads/, however all subsequent sites on your network
   > will be in the /wp-content/uploads/sites/ folder, in their own subfolder based
   > on the site number, designated by the database. These files will be accessible
   > via that URL.
   > This is a change from Multisite 3.0-3.4.2, where images of subsites were stored
   > in /wp-content/blogs.dir/ and were shown in [http://example.com/files/](http://example.com/files/)
   > and [http://example.com/sitename/files](http://example.com/sitename/files) 
   > and so on. If you started with a Multisite install older than 3.5, it is not
   > an error if your images show with the URL of /files/.
   > Regardless of WP version, these locations cannot be changed by site admins.
   > Only the network admin can make changes on the site settings page. It is not
   > recommended that you change these without understanding how both the ms-files.
   > php works in conjunction with your .htaccess, as it can easily become non-functional.
   > If the /files/ urls aren’t working, it’s indicative of a misconfigured .htaccess
   > or httpd.conf file on your server.
 * > If you installed WordPress MU in subfolder/subdirectory (not in root folder
   > on your server via ftp) and you have problem with image library, where thumbnails
   > and images do not show, you may need to manually add in rewrite rules for your
   > file directories as follows:
   >  `RewriteRule ^([_0-9a-zA-Z-]+/)?siteN/files/(.
   > +) wp-content/blogs.dir/N/files/$2 [L]`
   > Note* modify siteN in the sitename and modify (directory folder upload) N in
   > the (2,3,4 etc).
   >  Put those below the normal call for uploaded files.
 * If you initially installed WP MU or Multisite MU you will have blog.dir if you
   initially install WordPress 3.5 or higher wp-content/uploads/sites/ folder (2,3,4
   etc).
 * in network settings there are instructions on how to configure .htacces and wp-
   config.php
    backup your .htaccess file via permalink settings write in a sheet
   which you are using and try by clicking save. if it doesn’t work copy your .htaccess
   code in the forum code tags. You have direct.access to database (phpmyadmin or
   similar) ?
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [wp-cron.php problem](https://wordpress.org/support/topic/wp-cron-php-problem/)
 *  [autotutorial](https://wordpress.org/support/users/autotutorial/)
 * (@autotutorial)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/wp-cron-php-problem/page/2/#post-11605953)
 *     ```
       if(!is_array($cronhooks)){
       function var_x_error_log( $objectauto=null,$cronsauto=null ){
       ob_start(); // start buffer capture
       var_dump( $objectauto,$cronsauto ); // dump the value
       $contentsauto = ob_get_contents(); // put the buffer into a variable
       ob_end_clean(); // end capture
       error_log( $contentsauto."\n",3,dirname(__FILE__).'/test.log'); // log contents of the result of var_dump( $objectauto,$cronsauto )
       return $contentsauto;
       }
       var_x_error_log( $cronhooks,$crons );
       break;
       }
       ```
   
 * This shows the error in detail, the first array is $cronhooks (in your case bool
   false) all the other $crons. 🙂
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Upgrade Issues](https://wordpress.org/support/topic/upgrade-issues-29/)
 *  [autotutorial](https://wordpress.org/support/users/autotutorial/)
 * (@autotutorial)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/upgrade-issues-29/page/2/#post-11604959)
 * ok you have to proceed to update 2 minors at a time up to wordpress 3.7 if you
   have php 5.6.20 you can install wordpress 5.2.1 otherwise with php 5.2.4 wordpress
   5.1
    🙂
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [set cookie won’t work](https://wordpress.org/support/topic/n-set-cookie-wont-work/)
 *  [autotutorial](https://wordpress.org/support/users/autotutorial/)
 * (@autotutorial)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/n-set-cookie-wont-work/#post-11604908)
 * you cannot directly call the cookie because initially it does not exist you have
   tried as suggested by me and that your function can also return false?
 * [https://wordpress.org/support/topic/n-set-cookie-wont-work/#post-11589141](https://wordpress.org/support/topic/n-set-cookie-wont-work/#post-11589141)

Viewing 15 replies - 481 through 495 (of 706 total)

[←](https://wordpress.org/support/users/autotutorial/replies/page/32/?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)…
[32](https://wordpress.org/support/users/autotutorial/replies/page/32/?output_format=md)
33 [34](https://wordpress.org/support/users/autotutorial/replies/page/34/?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/34/?output_format=md)