autotutorial
Forum Replies Created
-
Forum: Installing WordPress
In reply to: Error establishing database connection – how to proceed nowSorry the code is not correct.
You simply need to replace mysqli_error($link) with mysqli_connect_error() for the connection error.
This codeUSE 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
In reply to: Update requires more recent PHP–how?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
In reply to: Redirecting to secondary siteWhile 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
In reply to: Error establishing database connection – how to proceed nowProve this SQL
USE yourdatabase; SHOW GLOBAL VARIABLES LIKE 'PORT'; SHOW GRANTS FOR CURRENT_USER;Into phpmyadmin.
Forum: Fixing WordPress
In reply to: Setting cron for multiple domainseach 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.
Forum: Fixing WordPress
In reply to: Setting cron for multiple domainsif 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 replace 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.5487570762634277343750Forum: Networking WordPress
In reply to: multisite non www gets redirected to main siteif 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
In reply to: CORS Blocking IssueUse this for SiteB
Access-Control-Allow-Origin: *
or
Access-Control-Allow-Origin: http://siteA.com/
?Forum: Installing WordPress
In reply to: Error establishing database connection – how to proceed nowHi 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 beforeForum: Installing WordPress
In reply to: Error establishing database connection – how to proceed now<?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 BomNote* 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. Reason: Add $link to mysqli_error function
Forum: Fixing WordPress
In reply to: Custom theme being replaced with WordPress.org theme – After UpdateI can think of blocking theme updates 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_ThemeClone your Chameleon with new name add it into define function for default theme.
Forum: Networking WordPress
In reply to: Blogs.dir in WP above 3.5Your 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/ and 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
In reply to: wp-cron.php problemif(!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
In reply to: Upgrade Issuesok 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
In reply to: set cookie won’t workyou 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