Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/456.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript wordpress插件js文件403_Javascript_Php_Wordpress - Fatal编程技术网

Javascript wordpress插件js文件403

Javascript wordpress插件js文件403,javascript,php,wordpress,Javascript,Php,Wordpress,从插件访问JS文件时出现问题: 当前实现(实现parsley.js库) 背景:Windows10-XAMPP1.8.2-Apache2.4,PHP5.6 wp_enqueue_script( 'parsley_script', plugin_dir_url( __FILE__ ).'js/parsley.min.js'); 文件显示并接收403 禁止进入! 您没有访问请求对象的权限。它受读保护,或者服务器不可读 错误日志显示 [访问\u compat:error][pid 4024:tid 2

从插件访问JS文件时出现问题: 当前实现(实现parsley.js库) 背景:Windows10-XAMPP1.8.2-Apache2.4,PHP5.6

wp_enqueue_script( 'parsley_script', plugin_dir_url( __FILE__ ).'js/parsley.min.js');
文件显示并接收403

禁止进入! 您没有访问请求对象的权限。它受读保护,或者服务器不可读

错误日志显示

[访问\u compat:error][pid 4024:tid 2456][client 127.0.0.1:62015]AH01797:客户端被服务器配置拒绝:

服务器配置

<Directory "D:/www/htdocs/wordpress">
        AllowOverride All
        Order allow,deny
        Allow from all
        Require all granted
</Directory>

允许超越所有
命令允许,拒绝
通融
要求所有授权
.htaccess

# BEGIN s2Member GZIP exclusions
<IfModule rewrite_module>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{QUERY_STRING} (^|\?|&)s2member_file_download\=.+ [OR]
    RewriteCond %{QUERY_STRING} (^|\?|&)no-gzip\=1
    RewriteRule .* - [E=no-gzip:1]
</IfModule>
# END s2Member GZIP exclusions

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
#开始成员GZIP排除
重新启动发动机
重写基/
RewriteCond%{QUERY\u STRING}(^ | \?|&)s2member\u文件下载\=.+[或]
RewriteCond%{QUERY\u STRING}(^ | \?|&)no gzip\=1
重写规则。*-[E=no gzip:1]
#结束成员GZIP排除
#开始WordPress
重新启动发动机
重写基/
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/index.php[L]
#结束WordPress
此类似问题在窗口框(权限)上无效

请帮忙。我可以将同一个文件添加到主题/目录中,但不会出现403错误。这是可以绕过的,但这件小事背后的原因让我无法相信。另外,我想将脚本与插件隔离开来,因为它不应该依赖于主题(因为插件创建所需的表单是一个短代码)

最简单的事情。。。 对于插件,我有一个.htaccess文件,它限制apache只提供png | gif文件。。。 /plugin\u dir/plugin\u name/.htaccess

<FilesMatch "^(.+)\.(png|gif)$">
Allow from all
</FilesMatch>

通融
这已调整为

<FilesMatch "^(.+)\.(png|gif|js|css)$">
Allow from all
</FilesMatch>

通融
这么简单的一件事,我在寻找的时候错过了。 自我(和他人)注意——不要先寻找最复杂的答案