Tools directory

Permalink
Hi,

I'm currently experiencing an error in development where requests to files in the tools folder do not have C5_EXECUTE defined, and do not have the standard C5 Loader class, etc initialized for use. This is in the root tools folder (not package/block tools folder).

Any help / ideas for what to look at for this would be appreciated.
The code is currently working on two environments of the website (developer's laptop environments, on windows) but not for the development server environment running on linux server. All file names are lowercase and spelled correctly)

.htaccess (for url rewrites) is below - looks normal to me and matches other C5 websites we've developed in the past.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>


Environment infomation (from dashboard) is as follows:

# concrete5 Version
5.5.1

# concrete5 Packages
Priceline Calendar (1.0.1), ProEvents (5.6.0).

# concrete5 Overrides
blocks/youtube, blocks/uber_info, blocks/form, blocks/pro_event_list, blocks/home_page_article_panel, blocks/afeature_panel, blocks/info_asset_area, blocks/image, blocks/search, blocks/autonav, blocks/survey, controllers/dashboard, elements/dashboard, elements/block_area_footer.php, elements/collection_add.php, elements/multiselect, elements/block_area_layout.php, elements/collection_theme.php, elements/pages, elements/files, elements/role_ajax_filter.php, elements/block_area_add_new.php, helpers/validation, helpers/db_data.php, js/jquery_clone.js, js/pinkportal, js/ui, js/jquery.ui.timepicker.js, js/jquery.loading.js, js/clone.js, js/jquery.AjaxSubmit2.0.js, css/jquery.loading.css, css/dashboard_calendar.css, css/jquery.ui.timepicker.css, css/jquery.loading, libraries/database_indexed_search_.php, libraries/Zend, libraries/ajax_actions_response.php, libraries/item_list.php, models/region_list.php, models/file_list.php, models/storeportal_group.php, models/user.php, models/state_list.php, models/store, models/calendar_event.php, models/collection.php, models/mage, models/system, models/calendar_category_list.php, models/attribute, models/storeportal_group_store_list.php, models/user_list.php, models/file_set.php, models/role_permissions_list.php, models/role_permissions_types.php, models/role_permissions_types_list.php, models/page.php, models/user_store.php, models/user_store_list.php, models/store_list.php, models/user_role_list.php, models/storeportal_group_list.php, models/storetype_list.php, models/area.php, models/role_permissions.php, models/storeportal_group_store.php, models/calendar_category.php, models/aussuburbs.php, models/mage.php, models/ownership_list.php, models/region_state_list.php, models/role_user_list.php, models/calendar_event_list.php, models/user_role.php, models/event_list.php, models/store.php, single_pages/dashboard, themes/b2c_priceline, themes/store_portal, tools/proevents, tools/edit_area_popup.php, tools/dashboard, tools/role_ajax_updater.php, tools/user, tools/add_event.php, tools/role_admin, tools/delete_event.php, tools/pages, tools/add_group.php, tools/paginate_display.php

# Server Software
Apache/2.2.21 (CentOS)

# Server API
apache2handler

# PHP Version
5.3.9

# PHP Extensions
apache2handler, apc, bz2, calendar, Core, ctype, curl, date, dom, ereg, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, imagick, json, libxml, mbstring, mcrypt, mhash, mysql, mysqli, ncurses, openssl, pcre, PDO, pdo_mysql, pdo_sqlite, Phar, Reflection, session, shmop, SimpleXML, soap, sockets, SPL, sqlite3, standard, tokenizer, wddx, wsf, xdebug, xml, xmlreader, xmlwriter, xsl, zip, zlib.

# PHP Settings
apc.max_file_size - 1M
log_errors_max_len - 1024
max_execution_time - 5
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 60
max_input_vars - 1000
memory_limit - 256M
post_max_size - 8M
safe_mode - Off
safe_mode_exec_dir - <i>no value</i>
safe_mode_gid - Off
safe_mode_include_dir - <i>no value</i>
sql.safe_mode - Off
upload_max_filesize - 10M
mysql.max_links - Unlimited
mysql.max_persistent - Unlimited
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
session.cache_limiter - nocache
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5
safe_mode_allowed_env_vars - PHP_
safe_mode_protected_env_vars - LD_LIBRARY_PATH
xdebug.max_nesting_level - 100
xdebug.var_display_max_children - 128
xdebug.var_display_max_data - 512
xdebug.var_display_max_depth - 3

View Replies:
joelcox replied on at Permalink Reply
Just found out that the concrete5 classes and constants, etc IS initialized correctly when accessed via /index.php/tools/XXXX instead of just /tools/XXXX

This has resolved the issue in the short-term as we can work-around it, however may indicate some kind of bug in handling requests to tools folder when URL rewriting is enabled. Is this a known bug that can happen? Fixes known for it, etc?

Thanks again
CWSpear replied on at Permalink Reply
CWSpear
Thanks for figuring that out. I was getting pretty frustrated that my tools file weren't wrapped in c5 like the documentation says, but when I added index.php, everything worked as expected.

That's weird that it requires index.php. It should automatically rewrite. I wonder if the problem's not in the htaccess, but somewhere, a router in c5 is incorrectly expecting index.php to always be there.

[EDIT] Nope, after investigating the $_SERVER variable on /index.php/tools/XXXX and /tools/XXXX it's because (at least my apache) automatically interprets /tools/XXXX (with & without ending slash) to /tools/XXXX.php. So it seems to definitely be related to the htaccess not kicking in (it fails the first RewriteCond) :-S
PerryGovier replied on at Permalink Reply
PerryGovier
with help from mkly on IRC I found another way that works.

to call the tool in
/tools/myTool.php

you'd call
/tools/required/myTool

odd, but it works
dude76 replied on at Permalink Reply
Hello,

i use C5 5.6. and installed a script page in: {root}/tools

But i cant see any content of it!!! Whats the mistake ???

On which other folder own script pages accepted too,
to open it by URL !?
Guido replied on at Permalink Reply
Guido
I have this same problem. It's working fine on my local machine with Apache but not working on my server, running nginx. Any solution for this yet?
Guido replied on at Permalink Reply
Guido
Solved this! As often is the problem, clear the cache...
katiam replied on at Permalink Reply
THANK YOU!
if you are visitingwww.www.yousite.com/index.php/tools/yourtool...
and it doesnt work... log into your website and clear its cache.
Had this exact problem as Guido- and clearing the cache solved it. THANX!
McArtney82 replied on at Permalink Reply
You have just saved me so much heartache, I've been trying to work the same problem out for hours! Thank you!
CaptainPanda replied on at Permalink Reply
I am attempting something similar, I want to make the order_print page loop, so that it prints all selected orders at the same time. (I have a javascript function which passes the values of the checkboxes to the URL when you press button).

I have followed what is written here and am getting "Unable to get permission key for read" how do I fix this?

Currently I am not looping anything, I am simply passing ?orderID=5&view_mode=dashboard to the URL (I am sure the order exists) but it goes to print_shipping_labels instead of order_print.

Any suggestions?