• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 434
  • Last Modified:

** 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/maxweisel/html/proxybypass/PHProxy.class.php on line 276

and on line 276 I have:

$this->url = decode_url($url);

How can I fix this.

Max
0
TheMaximumWeasel
Asked:
TheMaximumWeasel
  • 5
  • 3
1 Solution
 
TeRReFCommented:
$this->url = PHProxy::decode_url($url);
or
$this->url = PHProxy->decode_url($url);
0
 
TeRReFCommented:
If $this is already a PHProxy object,
$this->decode_url($url);
will suffice...
0
 
TeRReFCommented:
Sorry, you can forget about my last remark :)
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
TheMaximumWeaselAuthor Commented:
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/maxweisel/html/proxybypass/PHProxy.class.php on line 276

Max
0
 
TheMaximumWeaselAuthor Commented:
nvm the first one gives me this error:

Fatal error: Call to undefined method PHProxy::decode_url() in /var/www/hosting/max/maxweisel/html/proxybypass/PHProxy.class.php on line 276
0
 
TheMaximumWeaselAuthor Commented:
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
0
 
TeRReFCommented:
It works 'out of the box' for me on PHP 5.1.2
0
 
TeRReFCommented:
safe_mode needs to be turned off in your php.ini by the way...
0
 
castrumCommented:
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($url));
110            }
111            function decode_url($url)
112            {
113                return str_replace('&', '&', str_rot13(rawurldecode($url)));
114            }
115        }
116        else if ($this->flags['base64_encode'])
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($url));
110            }
111            function decode_url($url)
112            {
113                return str_replace('&', '&', rawurldecode($url));
114            }
115        }
116        else if ($this->flags['base64_encode'])
117        {
118            function encode_url($url)
119            {

let me know the results.. bye
               
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now