Athlon1600 / php-proxy

A web proxy script written in PHP and built as an alternative to Glype.
https://www.php-proxy.com
MIT License
298 stars 158 forks source link

white blank site #6

Closed Clevero closed 9 years ago

Clevero commented 9 years ago

Just installed the proxy via git clone (compuser install and composer update) on my debian 8 machine with php 5.6.5-1 installed.

When I post a URL in the "adress-bar" of the index site and then klick on GO!, my browser shows me a a white blank page. All sites are ending in this issue, even if there is nothing in the textfield.

Idea: I have firewalld installed, which blocks all ports. Are more ports than the port 80 needed?

Webserver: Apache

bennetthaselton commented 9 years ago

I have no idea how to configure that particular firewall, however, if you are running a proxy script on a website, then you not only need incoming connections to port 80 to be unblocked (apparently you've already taken care of this, since the proxy form loads successfully), you also need outgoing connections to port 80 on remote sites, to be unblocked as well. (That's for accessing non-SSL websites through the proxy, i.e., sites beginning with http:// . If you also want to access SSL sites, i.e. sites beginning with https:// , then you also have to unblock outgoing connections to port 443 on remote sites.)

However, I suspect that's not your problem, because if the problem was with outgoing connections being blocked, you'd probably see a graceful error from the proxy script saying, "Could not establish a connection to the remote site". If you're just getting a blank page then it may be some other error.

To get a more accurate error message, log in to the shell of the webserver and search the error log: 1) figure out what the webserver error log is (usually /var/log/httpd/error_log 2) take the name of the folder where you installed the proxy script 3) search the webserver log for those errors with: grep [foldername] [webserver log]

So for example on my machine, if the proxy script is at http://www.mysite.com/testproxy/ and the error log is /var/log/httpd/error_log , I would search: grep testproxy /var/log/httpd/error_log

That command will output the lines related to the script failure which will probably help pinpoint the problem.

Bennett

On 2/6/2015 10:09 AM, Clevero wrote:

Just installed the proxy via git clone (compuser install and composer update) on my debian 8 machine with php 5.6.5-1 installed.

When I post a URL in the "adress-bar" of the index site and then klick on GO!, my browser shows me a a white blank page. All sites are ending in this issue, even if there is nothing in the textfield.

Idea: I have firewalld installed, which blocks all ports. Are more ports than the port 80 needed?

Webserver: Apache

— Reply to this email directly or view it on GitHub https://github.com/Athlon1600/php-proxy/issues/6.

Athlon1600 commented 9 years ago

white page probably means some php error which was suppressed by default for security reasons. You need to go to php.ini and enable error reporting here: http://php.net/manual/en/function.error-reporting.php

Clevero commented 9 years ago

thanks alot for your response.

after enabling error reporting in php.ini, the log gave me the error "PHP Fatal error: Call to undefined function curl_init()".

The problem was, that curl was not installed. I thought it's enough to install the normal curl package. But the right package was "php5-curl", installing it fixed the problem.

bennetthaselton commented 9 years ago

On 2/6/2015 4:34 PM, Athlon1600 wrote:

white page probably means some php error which was suppressed by default for security reasons. You need to go to php.ini and enable error reporting here: http://php.net/manual/en/function.error-reporting.php

— Reply to this email directly or view it on GitHub https://github.com/Athlon1600/php-proxy/issues/6#issuecomment-73339268.

Note that if you see a blank page when errors occur, that has to do with the display_errors setting in php.ini and not with the error_reporting() function. The error_reporting() function determines what kind of errors are reported; the display_errors setting determines whether those errors are "reported" by displaying them to the browser (helpful sometimes, but considered unsafe for production systems), or whether they are merely written to the server's error log. (The reason that displaying errors to the browser is considered a security risk, is that if an attacker is visiting your site in their browser, they might be able to use the error message to determine something about your script that might lead them to discover a security hole.)

So if you want to see what error message the script is causing, you need to either: 1) look in the server's error log, usually /var/log/httpd/error_log , as I said in the last message or 2) edit the php.ini file and change the line display_errors = Off to display_errors = On and then restart httpd. And for safety, be sure to change that line back to "Off" (and restart httpd again) as soon as you're finished debugging.

Bennett