I recently encountered a similar issue! If you used the @wordpress/create-block
package to generate your block files, registration should work without issues. Here’s a potential solution:
If you manually created the block files, I recommend comparing your structure with the default one generated by @wordpress/create-block
. Ensure everything matches, and also double-check that you’re correctly registering the block using register_block_type() .
<?php
function my_custom_block_init() {
// Register the block using the block.json file or directly specify attributes.
register_block_type( DIR . '/build' );
}
add_action( 'init', 'my_custom_block_init' );
127.0.0.1
?Instead of?localhost
: Sometimes, XAMPP on macOS may have issues resolving?localhost
. Try changing?DB_HOST
?to?127.0.0.1
?in your?wp-config.php
?file:define('DB_HOST', '127.0.0.1');
admin
?user has privileges for the?wordpressdb
?database. In phpMyAdmin:
admin
?user has been assigned appropriate privileges for the?wordpressdb
?database.wp-config.php
:define('DB_HOST', '127.0.0.1:3306'); // Replace with the correct port if it's different
Method 1: No change – the maximum file size already says it’s set to 300 MB
Method 2: Applied
Method 3: Applied
Method 4: Unclear where in the “htaccess” file this code should go – can you advise?
Method 5: Applied
After applying what I could, it appears that the WordPress Admin panel is now accepting larger files. I appreciate the help! But, I want to understand how and where we should modify the htaccess file for future-proofing purposes. Can you assist with this?
]]>If you have a second to spare, kindly mark your topic as RESOLVED.
Thank you!
]]>Thanks.
mysql> SHOW GRANTS FOR wordpress@localhost -> ;+——————————————————————+| Grants for wordpress@localhost |+——————————————————————+| GRANT USAGE ON *.* TO wordpress
@localhost
|| GRANT ALL PRIVILEGES ON wordpress
.* TO wordpress
@localhost
|+——————————————————————+2 rows in set (0.00 sec)
This is my wp-config
// ** Database settings – You can get this info from your web host ** //
/** The name of the database for WordPress */
define( ‘DB_NAME’, ‘wordpress’ );
/** Database username */
define( ‘DB_USER’, ‘wordpress’ );
I am able to login to mysql using ‘sudo mysql -u wordpress -p ‘.
And are you able to SELECT the configured database after logging in as this user?
It’s not enough to have the correct username and password: also ensure that the user has all permissions on the individual database you’ve configured in wp-config.php
.
Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /srv/www/wordpress/wp-includes/class-wpdb.php on line 1987
No such file or directory
Error establishing a database connection
This either means that the username and password information in your wp-config.php
file is incorrect or that contact with the database server at localhost
could not be established. This could mean your host’s database server is down.
If you are unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress support forums.
]]>