Opened 15 years ago
Closed 15 years ago
#10262 closed defect (bug) (fixed)
Plugin editor fails without PHP tokenizer support
Reported by: | EasyTarget | Owned by: | |
---|---|---|---|
Milestone: | 2.8.1 | Priority: | low |
Severity: | blocker | Version: | 2.8 |
Component: | General | Keywords: | tokenizer |
Focuses: | Cc: |
Description
When trying to edit a plugin on my Wordpress following the 2.8 upgrade (from 2.7.1) the edit screen was blank. The header and admin sidebar remained, but the rest of the edit plugin page was entirely blank. In my logs I saw the following every time I selected 'edit' in the plugins menu:
[24-Jun-2009 14:22:38] PHP Fatal error: Call to undefined function token_get_all() in /usr/local/www/wordpress/wordpress/wp-admin/includes/misc.php on line 273
Only the plugin editor appeared affected.. the theme editor (which I assume is very similar code-wise) appeared to work correctly. Removing all plugins except 'hello dolly' failed to resolve this.
I have another WP install at work, also upgraded to 2.8 at the same time, and the plugin editor on that install works correctly. The failing system is my personal FreeBSD7.2 server, the working one being a Debian (Etch) system. Both fully updated.
Googling around I found the following thread on the WP forums:
http://wordpress.org/support/topic/277659
which lead on to:
http://wordpress.org/tags/token_get_all
On my personal system I did:
# cd /usr/ports/devel/php5-tokenizer/ && make install clean && apachectl restart
- Ie. install PHP tokenizer and restarts apache.
The plugin editor immediately started working correctly on my Wordpress.
So, it looks like php-tokenizer has become a requirement for Wordpress ;-)
or.. the plugin editor needs to be reworked to remove it's dependence on the tokenizer.
As the above threads note; tokenizer support is not always available/enabled for hosted PHP solutions.
Ideally the reliance on this should be removed.
Or (if it is actually 'a good thing(tm)') tokenizer support should be added to the WP requirements list so that affected end-users have some ammunition if their hosting provider asks 'why' they should enable it.
This is simple to fix. Just do a check for Tokenizer. The problem probably is that very few should disable tokenizer. You have to kind of go out of your way to disable it.