{"id":26163,"date":"2020-12-14T16:03:39","date_gmt":"2020-12-14T07:03:39","guid":{"rendered":"https:\/\/tadtadya.com\/en\/?p=26163"},"modified":"2021-01-25T14:47:14","modified_gmt":"2021-01-25T05:47:14","slug":"wordpress-when-the-wp-command-is-not-available","status":"publish","type":"post","link":"https:\/\/tadtadya.com\/en\/wordpress-when-the-wp-command-is-not-available\/","title":{"rendered":"WordPress, When the wp command is not available"},"content":{"rendered":"\n<p>The 'wp' command in WordPress allows you to do things like you would do in the admin panel by entering commands.<\/p>\n\n\n\n<p>However, there were times when the 'wp' command did not work, which happened to me four times. I was just using it wrong.<\/p>\n\n\n\n<p>If you use it in the same way as a shell command, you will get an error immediately.<\/p>\n\n\n\n<!--more-->\n\n\n\n<div class=\"wp-block-origin-block-msg-box\"><div class=\"msgbox msgbox-notice v1\"><i class=\"fas fa-exclamation-triangle icon\"><\/i><div class=\"msg\">\n<p>This is written by a Japanese who can't speak English with the help of translation application. Sorry if it's not good.<\/p>\n<\/div><\/div><\/div>\n\n\n\n<p>The 'wp' command is the 'wp-cli' module, which controls WordPress from the command line.<\/p>\n\n\n\n<p>What you can do in the WordPress admin panel, you can also do with the 'wp' command. In addition, you can also do things that directly affect the system, such as building test environments and manipulating databases.<\/p>\n\n\n\n<p>This is an advanced WordPress management tool.<\/p>\n\n\n\n<p>However, it is not a standard tool of WordPress. The development project is also independent of WordPress.<\/p>\n\n\n\n<p>When you install WordPress, there is no 'wp-cli' module. You will need to install it yourself.<\/p>\n\n\n\n<p>So much for the explanation, the 'wp' command often causes errors like this.<\/p>\n\n\n\n<div class=\"pre-code-title\">Error in wp command<\/div><pre class=\" command-line\" data-user=\"\" data-output=\"2\"><code class=\"language-bash\">wp core check-update\nError: This does not seem to be a WordPress install. Pass --path=`path\/to\/wordpress` or run `wp core download`.<\/code><\/pre>\n\n\n\n<div class=\"wp-block-origin-block-balloon balloon-com balloon-left\"><div class=\"name\"><\/div><div class=\"type talk talk3\"><img\/><div class=\"text\">WordPress is not installed?<\/div><\/div><\/div>\n\n\n\n<div class=\"wp-block-origin-block-balloon balloon-com balloon-left\"><div class=\"name\"><\/div><div class=\"type talk talk3\"><img\/><div class=\"text\">What? Why? I have WordPress?<\/div><\/div><\/div>\n\n\n\n<p>This is an error that I think about over and over again.<\/p>\n\n\n\n<p>This error is caused by the 'wp' command not being able to recognize the WordPress installation path.<\/p>\n\n\n\n<p>You don't need to download wp-core, it is a core module of WordPress, so it is included in WordPress.<\/p>\n\n\n\n<p>There are two solutions: either<\/p>\n\n\n\n<div class=\"wp-block-origin-block-em-box em-group em-group-default\">\n<ul><li>Execute the command in the WordPress installation directory.<\/li><li>Specify the option '--path=\"\/xxx\/xxx\/DocumentRoot\"' with the 'wp' command<\/li><\/ul>\n<\/div>\n\n\n\n<div class=\"pre-code-title\">Move the directory and execute the command.<\/div><pre class=\" command-line\" data-user=\"\" data-output=\"\"><code class=\"language-bash\">cd \/home\/myuser\/sample\/DocumentRoot\nwp core check-update<\/code><\/pre>\n\n\n\n<p>You can run it in any level of your WordPress installation. It can be the plugin directory, or the theme file directory.<\/p>\n\n\n\n<div class=\"pre-code-title\">Execute the command with the '--path' option<\/div><pre class=\" command-line\" data-user=\"\" data-output=\"\"><code class=\"language-bash\">wp core check-update --path=\"\/home\/myuser\/sample\/DocumentRoot\"<\/code><\/pre>\n\n\n\n<div class=\"wp-block-origin-block-em-box em-group em-group-reference\">\n<p><strong><a href=\"https:\/\/wp-cli.org\/\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"wp-cli official\">wp-cli official<\/a><\/strong><\/p>\n<\/div>\n\n<!-- WP QUADS Content Ad Plugin v. 2.0.65.1 -->\n<div class=\"quads-location quads-ad2\" id=\"quads-ad2\" style=\"float:none;margin:0px;\">\n<ul class=\"quads-location-ul\">\r\n<li class=\"quads-location-li li-1\">\r\n<script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\r\n<ins class=\"adsbygoogle\"\r\n     style=\"display:block\"\r\n     data-ad-client=\"ca-pub-4926008942376207\"\r\n     data-ad-slot=\"6550760310\"\r\n     data-ad-format=\"auto\"\r\n     data-full-width-responsive=\"true\"><\/ins>\r\n<script>\r\n     (adsbygoogle = window.adsbygoogle || []).push({});\r\n<\/script>\r\n<\/li>\r\n<li class=\"quads-location-li li-2\">\r\n<script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\r\n<ins class=\"adsbygoogle\"\r\n     style=\"display:block\"\r\n     data-ad-client=\"ca-pub-4926008942376207\"\r\n     data-ad-slot=\"6550760310\"\r\n     data-ad-format=\"auto\"\r\n     data-full-width-responsive=\"true\"><\/ins>\r\n<script>\r\n     (adsbygoogle = window.adsbygoogle || []).push({});\r\n<\/script>\r\n<\/li>\r\n<\/ul>\n<\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>The 'wp' command in WordPress allows you to do things like you would do in the admin panel by entering commands. However, there were times when the 'wp' command did not work, which happened to me four times. I was just using it wrong. If you use it in the same way as a shell command, you will get an error immediately.<\/p>\n","protected":false},"author":1,"featured_media":12486,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"jetpack_publicize_message":"When the wp command is not available, check it.\n\nI don't know why I forget it so easily.\n\n#Wordress\n#wp-cli\n","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_options":[]},"categories":[9,42,43],"tags":[38,552,553],"jetpack_publicize_connections":[],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/tadtadya.com\/en\/wp-content\/uploads\/sites\/2\/2018\/10\/wordpress-1.png?fit=1280%2C671&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8Qw77-6NZ","jetpack_likes_enabled":false,"_links":{"self":[{"href":"https:\/\/tadtadya.com\/en\/wp-json\/wp\/v2\/posts\/26163"}],"collection":[{"href":"https:\/\/tadtadya.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tadtadya.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tadtadya.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tadtadya.com\/en\/wp-json\/wp\/v2\/comments?post=26163"}],"version-history":[{"count":0,"href":"https:\/\/tadtadya.com\/en\/wp-json\/wp\/v2\/posts\/26163\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tadtadya.com\/en\/wp-json\/wp\/v2\/media\/12486"}],"wp:attachment":[{"href":"https:\/\/tadtadya.com\/en\/wp-json\/wp\/v2\/media?parent=26163"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tadtadya.com\/en\/wp-json\/wp\/v2\/categories?post=26163"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tadtadya.com\/en\/wp-json\/wp\/v2\/tags?post=26163"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}