TheMaximumWeasel
asked on
** EASY 500 POINTS ** Fix Script For PHP5
I installed PHProxy on my webserver and I get this error because of some problem with running a PHP4 script on a PHP5 Server
Fatal error: Non-static method PHProxy::decode_url() cannot be called statically in /var/www/hosting/max/maxwe isel/html/ proxybypas s/PHProxy. class.php on line 276
and on line 276 I have:
$this->url = decode_url($url);
How can I fix this.
Max
Fatal error: Non-static method PHProxy::decode_url() cannot be called statically in /var/www/hosting/max/maxwe
and on line 276 I have:
$this->url = decode_url($url);
How can I fix this.
Max
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sorry, you can forget about my last remark :)
ASKER
When I use the first solution ( $this->url = PHProxy::decode_url($url); ) I get the same error and with the second one ( $this->url = PHProxy->decode_url($url); ) I get this error:
Parse error: parse error, unexpected T_OBJECT_OPERATOR in /var/www/hosting/max/maxwe isel/html/ proxybypas s/PHProxy. class.php on line 276
Max
Parse error: parse error, unexpected T_OBJECT_OPERATOR in /var/www/hosting/max/maxwe
Max
ASKER
nvm the first one gives me this error:
Fatal error: Call to undefined method PHProxy::decode_url() in /var/www/hosting/max/maxwe isel/html/ proxybypas s/PHProxy. class.php on line 276
Fatal error: Call to undefined method PHProxy::decode_url() in /var/www/hosting/max/maxwe
ASKER
Download PHProxy from sourceforge version 0.4 and see if you can get it to work on a server with php 5.0.4 because that is my only problem is it doesn't work on php 5.
Max
Max
It works 'out of the box' for me on PHP 5.1.2
safe_mode needs to be turned off in your php.ini by the way...
hi TheMaximumWeasel ,
I think your problem is str_rot13 encoding function... . try this:
remove str_rot13 from 113th line...
105 if ($this->flags['rotate13'])
106 {
107 function encode_url($url)
108 {
109 return rawurlencode(str_rot13($ur l));
110 }
111 function decode_url($url)
112 {
113 return str_replace('&', '&', str_rot13(rawurldecode($ur l)));
114 }
115 }
116 else if ($this->flags['base64_enco de'])
117 {
118 function encode_url($url)
119 {
new code is like that:
105 if ($this->flags['rotate13'])
106 {
107 function encode_url($url)
108 {
109 return rawurlencode(str_rot13($ur l));
110 }
111 function decode_url($url)
112 {
113 return str_replace('&', '&', rawurldecode($url));
114 }
115 }
116 else if ($this->flags['base64_enco de'])
117 {
118 function encode_url($url)
119 {
let me know the results.. bye
I think your problem is str_rot13 encoding function... . try this:
remove str_rot13 from 113th line...
105 if ($this->flags['rotate13'])
106 {
107 function encode_url($url)
108 {
109 return rawurlencode(str_rot13($ur
110 }
111 function decode_url($url)
112 {
113 return str_replace('&', '&', str_rot13(rawurldecode($ur
114 }
115 }
116 else if ($this->flags['base64_enco
117 {
118 function encode_url($url)
119 {
new code is like that:
105 if ($this->flags['rotate13'])
106 {
107 function encode_url($url)
108 {
109 return rawurlencode(str_rot13($ur
110 }
111 function decode_url($url)
112 {
113 return str_replace('&', '&', rawurldecode($url));
114 }
115 }
116 else if ($this->flags['base64_enco
117 {
118 function encode_url($url)
119 {
let me know the results.. bye
$this->decode_url($url);
will suffice...