Viewing 10 replies - 1 through 10 (of 10 total)
  • Ok I may understand your issue but it is still strange … Obviously, the plugin is not able to list the files in the /lang/ directory of the plugin…

    Are you able to modify the rights on that folder to allow such listing ?

    Normally, the mentioned line (ie. 998) should only be called when a admin or a logged user access an admin page …
    You are really talking about millions entries ?

    Thread Starter markusN

    (@markusn)

    Thanks for your immediate response!

    Yes, 3.3 million lines in the apache error.log generated in no time… (I used grep/wc -l to count).

    I installed the plugin through the WP interface, so I would expect that the file rights are correct. I am root on the system, so I could check/modify knowing a bit better, what to try.

    Could you give me the rights on the lang folder and what user is used to execute the php script (apache, etc.) ?
    The user should have the right to read, write and execute on that folder to avoid any problem

    I may have an idea regarding the number of entries … Is xx.yy.197.131 your IP address ?

    I have a backup solution if you are not able to set the right correctly

    Thread Starter markusN

    (@markusn)

    Concering the permission:

    ps -aef | grep apache
    root 11472 1 0 15:28 ? 00:00:00 /usr/sbin/apache2 -k start
    root 19676 11472 0 16:29 ? 00:00:00 /usr/sbin/apache2 -k start

    Why are write permissions needed on the lang/ folder?

    root@markus /var/lib/wordpress/wp-content/plugins/content-table # l lang/
    total 100K
    -rw-r–r– 1 www-data www-data 3.4K Dec 30 14:53 tableofcontent-de_DE.mo
    -rw-r–r– 1 www-data www-data 4.1K Dec 30 14:53 tableofcontent-de_DE.po
    -rw-r–r– 1 www-data www-data 2.9K Dec 30 14:53 tableofcontent-es_ES.mo
    -rw-r–r– 1 www-data www-data 4.2K Dec 30 14:53 tableofcontent-es_ES.po
    -rw-r–r– 1 www-data www-data 2.8K Dec 30 14:53 tableofcontent-es_MX.mo
    -rw-r–r– 1 www-data www-data 4.1K Dec 30 14:53 tableofcontent-es_MX.po
    -rw-r–r– 1 www-data www-data 2.6K Dec 30 14:53 tableofcontent-fi_FI.mo
    -rw-r–r– 1 www-data www-data 3.9K Dec 30 14:53 tableofcontent-fi_FI.po
    -rw-r–r– 1 www-data www-data 3.2K Dec 30 14:53 tableofcontent-fr_FR.mo
    -rw-r–r– 1 www-data www-data 3.8K Dec 30 14:53 tableofcontent-fr_FR.po
    -rw-r–r– 1 www-data www-data 3.8K Dec 30 14:53 tableofcontent-it_IT.mo
    -rw-r–r– 1 www-data www-data 4.6K Dec 30 14:53 tableofcontent-it_IT.po
    -rw-r–r– 1 www-data www-data 2.9K Dec 30 14:53 tableofcontent-nl_NL.mo
    -rw-r–r– 1 www-data www-data 3.5K Dec 30 14:53 tableofcontent-nl_NL.po
    -rw-r–r– 1 www-data www-data 4.1K Dec 30 14:53 tableofcontent.pot
    -rw-r–r– 1 www-data www-data 1.1K Dec 30 14:53 tableofcontent-ro_RO.mo
    -rw-r–r– 1 www-data www-data 1.8K Dec 30 14:53 tableofcontent-ro_RO.po
    -rw-r–r– 1 www-data www-data 3.4K Dec 30 14:53 tableofcontent-ru_RU.mo
    -rw-r–r– 1 www-data www-data 4.8K Dec 30 14:53 tableofcontent-ru_RU.po

    Concerning the “error.log” entries:
    – I install the plugin via WP, then activate,
    – when going in “SL Plugins”, “Table of contents” the warning “pumping” starts:

    head error.log
    [Mon Dec 30 15:28:30 2013] [notice] Apache/2.2.22 (Debian) DAV/2 SVN/1.6.17 PHP/5.4.4-14+deb7u7 mod_ssl/2.2.22 OpenSSL/1.0.1e configured — resuming normal operations
    [Mon Dec 30 17:36:58 2013] [error] [client xxx.62.11.251] PHP Warning: readdir() expects parameter 1 to be resource, boolean given in /var/lib/wordpress/wp-content/plugins/content-table/core/translation.class.php on line 998, referer: https://courses.neteler.org/wp-admin/plugins.php?activate=true&plugin_status=all&paged=1&s=
    [Mon Dec 30 17:36:58 2013] [error] [client xxx.62.11.251] PHP Warning: readdir() expects parameter 1 to be resource, boolean given in /var/lib/wordpress/wp-content/plugins/content-table/core/translation.class.php on line 998, referer: https://courses.neteler.org/wp-admin/plugins.php?activate=true&plugin_status=all&paged=1&s=

    [… cut …]

    [Mon Dec 30 17:37:35 2013] [error] [client xxx.62.11.251] PHP Warning: readdir() expects parameter 1 to be resource, boolean given in /var/lib/wordpress/wp-content/plugins/content-table/core/translation.class.php on line 998, referer: https://courses.neteler.org/wp-admin/plugins.php?activate=true&plugin_status=all&paged=1&s=

    –> in less than 1 minute I get almost 3 million errors:
    grep ‘PHP Warning: readdir() expects parameter 1’ error.log | wc -l
    2873977

    … my server seems to be fairly fast ?? So, a loop somewhere?

    The IP address is dynamic and the one from where I access right now.

    It is not a loop but a “while” that normally does end … but not in this case : if the folder lang is not readable, the following line seems to be always true …

    $dir = @opendir($path."/lang/");
    while(false !== ($item = readdir($dir))) {
       ...
    }

    I will correct it in a next version… In the meanwhile, you have to set to the lang folder a x (execute rights) for the www-data users

    The write in only optional if you decide to modify the translations

    Thread Starter markusN

    (@markusn)

    The current (yet unmodified) permissions are:

    drwxr-xr-x 2 www-data www-data 4.0K Dec 30 17:36 lang

    .. this does not suffice? (thanks again for your support)

    I believe so … But you have to told me !
    I will release a new version correcting this issue

    Thread Starter markusN

    (@markusn)

    Thanks a lot, looking forward to test it!

    That will be corrected in the next version… which be release in minutes

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘PHP Warning: readdir() expects parameter 1 to be resource’ is closed to new replies.