Page 1 of 1

[SOLVED] Pretty URL & Hierarchy error

Posted: Tue Feb 12, 2008 3:45 am
by coupet
The page load with the error messages:

Warning: Compilation failed: unrecognized character after (? at offset 2 in /home/httpd/vhosts/sitename.tld/httpdocs/cms/index.php on line 126

I get this error message when:
  $config['use_hierarchy'] = true;

When I change as follows:
  $config['use_hierarchy'] = false;
No error messages and page loads OK.

Using:
$config['assume_mod_rewrite'] = true;

Thankls, Darly

Re: Pretty URL & Hierarchy error

Posted: Tue Feb 12, 2008 8:29 am
by alby
coupet wrote: The page load with the error messages:
I am not a guru on this but I feel a little bit your informations.....
At least:
- CMSMS version
- relative part of config
- your htaccess
- ...

Alby

Re: Pretty URL & Hierarchy error

Posted: Tue Feb 12, 2008 2:47 pm
by coupet
----- version -----
CMSMS version 1.2.3

----- .htaccess -----
Options -Indexes
Options +FollowSymLinks
ErrorDocument 403 /forbidden403.shtml

RewriteEngine on
RewriteBase /cms
#RewriteBase /cms/ ***both work

# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]
RewriteRule ^News/rss(.+)$ index.php?page=News/rss$1 [S=1

# CMSMS Rewriting
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ /cms/index.php?page=$1 [QSA]
#RewriteRule ^(.+)$ index.php?page=$1 [QSA] ***both work


----- config.php -----
#URL Settings
$config['assume_mod_rewrite'] = true;
$config['page_extension'] = '';
$config['internal_pretty_urls'] = false;
$config['use_hierarchy'] = true;
#$config['use_hierarchy'] = false; ***works
$config['query_var'] = 'page';

Re: Pretty URL & Hierarchy error

Posted: Tue Feb 12, 2008 2:56 pm
by alby
I leave to others experts but I believe that red row does not work if you enable RewriteBase:
coupet wrote: RewriteEngine on
RewriteBase /cms
#RewriteBase /cms/ ***both work


RewriteRule ^(.+)$ /cms/index.php?page=$1 [QSA]
#RewriteRule ^(.+)$ index.php?page=$1 [QSA] ***both work
Try to use:
RewriteBase /cms
RewriteRule ^(.+)$ index.php?page=$1 [QSA]

Alby

Re: Pretty URL & Hierarchy error

Posted: Tue Feb 12, 2008 3:12 pm
by coupet
Made changes and results follows:

http://sitename.tld/cms/page1/subpage1/subsubpage1/
Warning: Compilation failed: unrecognized character after (? at offset 2 in /home/httpd/vhosts/sitename.tld/httpdocs/cms/index.php on line 126

http://sitename.tld/cms/page1/subpage1/
Warning: Compilation failed: unrecognized character after (? at offset 2 in /home/httpd/vhosts/sitename.tld/httpdocs/cms/index.php on line 126

http://sitename.tld/cms/page1/
No error - works

Note:
$config['use_hierarchy'] = true;

Re: Pretty URL & Hierarchy error

Posted: Tue Feb 12, 2008 4:35 pm
by coupet
Google sentence within quotes:
"Warning: Compilation failed: unrecognized character after (? at offset 2 in"

preg_match() issue ?

Darly

Re: Pretty URL & Hierarchy error

Posted: Tue Feb 12, 2008 5:18 pm
by nivekiam
Can you post a link to phpinfo?

I'm suspecting either corrupt files from when you uploaded (very likely if you uploaded via FTP) or some odd config with PHP.

Re: Pretty URL & Hierarchy error

Posted: Tue Feb 12, 2008 6:16 pm
by coupet
Everything works except Pretty URLs hierarchy.

PHP Version 4.3.2

Configuration
PHP Core
Directive Local Value Master Value
allow_call_time_pass_reference On On
allow_url_fopen On On
always_populate_raw_post_data Off Off
arg_separator.input & &
arg_separator.output & &
asp_tags Off Off
auto_append_file no value no value
auto_prepend_file no value no value
browscap no value no value
default_charset no value no value
default_mimetype text/html text/html
define_syslog_variables Off Off
disable_classes no value no value
disable_functions no value no value
display_errors On On
display_startup_errors Off Off
doc_root no value no value
docref_ext no value no value
docref_root no value no value
enable_dl On On
error_append_string no value no value
error_log /var/log/php.log /var/log/php.log
error_prepend_string no value no value
error_reporting 2039 2039
expose_php On On
extension_dir /usr/lib/php4 /usr/lib/php4
file_uploads On On
gpc_order GPC GPC
highlight.bg #FFFFFF #FFFFFF
highlight.comment #FF8000 #FF8000
highlight.default #0000BB #0000BB
highlight.html #000000 #000000
highlight.keyword #007700 #007700
highlight.string #DD0000 #DD0000
html_errors On On
ignore_repeated_errors Off Off
ignore_repeated_source Off Off
ignore_user_abort Off Off
implicit_flush Off Off
include_path .:/usr/share/pear .:/usr/share/pear
log_errors On On
log_errors_max_len 1024 1024
magic_quotes_gpc On On
magic_quotes_runtime Off Off
magic_quotes_sybase Off Off
max_execution_time 30 30
max_input_time 60 60
memory_limit 64M 64M
open_basedir /home/httpd/vhosts/sitename.ltd/httpdocs:/tmp no value
output_buffering no value no value
output_handler no value no value
post_max_size 64M 64M
precision 14 14
register_argc_argv On On
register_globals Off Off
report_memleaks On On
safe_mode Off Off
safe_mode_exec_dir no value no value
safe_mode_gid Off Off
safe_mode_include_dir no value no value
sendmail_from me@localhost.com me@localhost.com
sendmail_path /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i
serialize_precision 100 100
short_open_tag On On
SMTP localhost localhost
smtp_port 25 25
sql.safe_mode Off Off
track_errors Off Off
unserialize_callback_func no value no value
upload_max_filesize 64M 64M
upload_tmp_dir no value no value
user_dir no value no value
variables_order EGPCS EGPCS
xmlrpc_error_number 0 0
xmlrpc_errors Off Off
y2k_compliance On On

mysql
MySQL Support enabled
Active Persistent Links 2
Active Links 2
Client API version 3.23.58
MYSQL_MODULE_TYPE external
MYSQL_SOCKET /var/lib/mysql/mysql.sock
MYSQL_INCLUDE -I/usr/include/mysql
MYSQL_LIBS -L/usr/lib/mysql -lmysqlclient

Directive Local Value Master Value
mysql.allow_persistent On On
mysql.connect_timeout -1 -1
mysql.default_host no value no value
mysql.default_password no value no value
mysql.default_port no value no value
mysql.default_socket no value no value
mysql.default_user no value no value
mysql.max_links Unlimited Unlimited
mysql.max_persistent Unlimited Unlimited
mysql.trace_mode Off Off

Re: Pretty URL & Hierarchy error

Posted: Thu Feb 14, 2008 6:13 pm
by Pierre M.
Hello,

FTP or SSH ?

Please try to clear the server's cache.

Pierre M.

Re: Pretty URL & Hierarchy error

Posted: Fri Feb 15, 2008 12:02 am
by coupet
FTP (Filezilla) latest version.
Reuploaded all distribution files.

Error occurs when I enable hierarchy in config.php
$config['use_hierarchy'] = true;

Error disappear when I disable hierarchy in config.php
$config['use_hierarchy'] = false;

Note: Everything else works (Admin & Front-end)

Darly

Re: Pretty URL & Hierarchy error

Posted: Fri Feb 15, 2008 3:14 pm
by Pierre M.
According to the requirements, PHP 4.3.2 may be not enough for beautifying URLs.

Pierre M.

Re: Pretty URL & Hierarchy error

Posted: Fri Feb 15, 2008 3:47 pm
by coupet
@ Pierre, Exactly right!

Requirements
-------------------
PHP 4.3+

    * 4.3.3+ required for pretty URL's
    * Working PHP sessions
    * PHP Tokenizer support

Darly