admin管理员组文章数量:1122846
My error when writing a plugin for uploads
and yes, I can debug. But it just jumps directly from this line to destruct
the end of my wp-config.php
EDIT:
// Enable WP_DEBUG mode
define('WP_DEBUG', true);
// Enable Debug logging to the /wp-content/debug.log file
define('WP_DEBUG_LOG', true);
/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');
(yes i did restart)
My webcontent folder
So now what?
How do I find out what is the problem?
EDIT it's not file permission as I can do
error_log("errrorrrr ", 3 , "..../debug.log")
In my plugin I wrote the line
throw new \Exception("foo");
I want to get to see the error in my debug.log file
My error when writing a plugin for uploads
and yes, I can debug. But it just jumps directly from this line to destruct
the end of my wp-config.php
EDIT:
// Enable WP_DEBUG mode
define('WP_DEBUG', true);
// Enable Debug logging to the /wp-content/debug.log file
define('WP_DEBUG_LOG', true);
/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');
(yes i did restart)
My webcontent folder
So now what?
How do I find out what is the problem?
EDIT it's not file permission as I can do
error_log("errrorrrr ", 3 , "..../debug.log")
In my plugin I wrote the line
throw new \Exception("foo");
I want to get to see the error in my debug.log file
Share Improve this question edited May 27, 2015 at 16:48 Toskan asked Feb 10, 2015 at 8:23 ToskanToskan 5242 gold badges8 silver badges23 bronze badges 9 | Show 4 more comments6 Answers
Reset to default 15 +50Insert this into your wp-config.php
// Enable WP_DEBUG mode
define('WP_DEBUG', true);
// Enable Debug logging to the /wp-content/debug.log file
define('WP_DEBUG_LOG', true);
// Disable display of errors and warnings
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors',0);
Before
/* That's all, stop editing! Happy blogging. */
I had a similar issue when the permissions on the upload dir were not allowing the upload, try that first. Take a look at the codex Changing_File_Permissions for more info.
Alternatively, check that the uploads dir is owned by the same user (on the server) as Wordpress, it's also mentioned in the above link.
For how to... please find someone with more experience ;)
Toskan,
It seems like your wordpress file is not uploaded, so there may be a possibility for one or more issue, Please read out following and apply these solution one by one:
Large images require more memory to process. Are these images particularly large? If yes then try with small image.
Uploaded folder should have write permission, if not then please grant it.
Need to check uploaded directory structure having sub folder created with your current setting OR not, if not then try it manually may be this is again folder permission issue.
If above points is not your solution then please use wordpress plugin 'Debug My Plugin' with Debug Bar(https://wordpress.org/plugins/debug-my-plugin)
It adds a debug menu to the admin bar that shows query, cache and other helpful debugging information.
Also 'Query Monitor'(http://wordpress.org/plugins/query-monitor) is monitoring database queries, hooks, conditionals, HTTP requests, query vars, environment, redirects including automatic AJAX debugging and more.
I hope you find this detail helpful. If you have any query or suggestions to achieve the same result as above plugins does, do share with us.
Thanks!
Another thing to check for is where the WP_CONTENT_DIR
points as that is where the debug.log
file will be put. This can be set in wp-config.php
e.g. define('WP_CONTENT_DIR', '/var/www/sites/wordpress/wp-content');
. Normally it shouldn't need to be set unless there's a non-standard setup. The value of WP_CONTENT_DIR
may be checked as suggested in this question, or using the Wordfence plugin->Tools->Diagnostics->WordPress Settings.
In my case, I use XAMPP to host WordPress, the log will be in Apache's error.log instead even I have wp-config.php configured.
I also faced this error. What I did was to first create the debug.log file under the wp-content directory. I realized that errors were not logging in this file. Eventually, I decided to change the permission for this file (right-click on the created debug.log file in cPanel, and click on Change Permissions). I changed to 777 (This enables write rule for the file).
I hope it helps!
本文标签: plugin developmentNo Error Log Fileno debug info
版权声明:本文标题:plugin development - No Error Log File, no debug info 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736312363a1935074.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
error_log("errrorrrr ");
– Toskan Commented May 25, 2015 at 20:26wp-config.php
"... Is it literally the end? Constants definition goes before the linerequire_once(ABSPATH . 'wp-settings.php');
or it does nothing... – gmazzap Commented May 26, 2015 at 1:55