我想在wordpress安装中安装graphql-wp插件。
我已根据these说明成功安装了作曲家:
我的wordpress网站安装在:
/var/www/html/wordpress
我已将条目重定向到该文件夹:
<VirtualHost *: 80>
DocumentRoot /var/www/html/wordpress
ServerName mydomain.com
<Directory /var/www/html/wordpress>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow, deny
Allow from all
</Directory>
ErrorLog $ {APACHE_LOG_DIR} /error.log
CustomLog $ {APACHE_LOG_DIR} /access.log combined
</VirtualHost>
我按照以下步骤操作:
cd /var/www/html/wordpress
composer require mohiohio/graphql-wp
一切似乎都安装正确:
Using version ^ 0.1.3 for mohiohio / graphql-wp
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 4 installs, 0 updates, 0 removals
- Installing webonyx / graphql-php (v0.6.4): Loading from cache
- Installing mohiohio / wordpress-lib (0.1.4): Loading from cache
- Installing ivome / graphql-relay-php (v0.1.3): Loading from cache
- Installing mohiohio / graphql-wp (0.1.3): Loading from cache
Writing lock file
Generating autoload files
然后我还通过添加以下行来修改index.php:
require (dirname (__ FILE__). '/vendor/autoload.php');
但是当我去我的网站时:
mydomain.com/graphql
我收到404错误。
(OOPS!无法找到那页)