Black page for php files after fresh installation

21 posts / 0 new
Last post
#1 Wed, 10/28/2015 - 05:34
xdude

Black page for php files after fresh installation

First time installing Virtualmin. After few failures I got it installed to a point. Now the problem I have is it's showing me a blank page for testing domain which is the one i use for namesevers.

I know it has to be something to do with php but I had this same problem before when I tried to installed Kloxo-MR in same server. Same problem just a while blank page for php files.

I tested phpinfo file and it works fine

tried to add On value to open_basedir but it doesn't save it. Even after reboot phpinfo shows novalue for that.

Even changed php memory limit to 256M

my test domain is buydesign.info

CentOS 6.7 32bit version

I have been reading things and testing since yesterday but couldn't find a solution :(

Wed, 10/28/2015 - 09:12
andreychek

Howdy,

Let's start with the blank page issue you're experiencing. If you're getting a blank page, you may want to take a look in the Apache error log for that domain, which is located in $HOME/logs/error_log.

When looking in there for the domain experiencing that problem, do you see any errors?

-Eric

Wed, 10/28/2015 - 09:26
xdude

Thank you for responding. Here's the Apache error log,

[Wed Oct 28 11:04:37 2015] [warn] [client 104.171.122.98] mod_fcgid: stderr: PHP Parse error:  syntax error, unexpected T_STRING, expecting ',' or ';' in /home/buydesign/public_html/index.php on line 3
[Wed Oct 28 11:07:01 2015] [error] [client 112.134.81.191] File does not exist: /home/buydesign/public_html/favicon.ico, referer: http://www.buydesign.info/
[Wed Oct 28 11:38:54 2015] [warn] [client 112.134.80.183] mod_fcgid: stderr: PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/3.0/no DST' instead in /home/buydesign/public_html/index.php on line 1
[Wed Oct 28 12:16:26 2015] [warn] [client 112.134.80.183] mod_fcgid: stderr: PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/3.0/no DST' instead in /home/buydesign/public_html/index.php on line 1
[Wed Oct 28 12:18:13 2015] [warn] [client 112.134.80.183] mod_fcgid: stderr: PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/3.0/no DST' instead in /home/buydesign/public_html/index.php on line 1
[Wed Oct 28 12:45:50 2015] [warn] [client 112.134.80.183] mod_fcgid: stderr: PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/3.0/no DST' instead in /home/buydesign/public_html/index.php on line 1
[Wed Oct 28 12:51:53 2015] [warn] [client 112.134.80.183] mod_fcgid: stderr: PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/3.0/no DST' instead in /home/buydesign/public_html/index.php on line 1
[Wed Oct 28 12:54:17 2015] [warn] [client 112.134.80.183] mod_fcgid: stderr: PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/3.0/no DST' instead in /home/buydesign/public_html/index.php on line 1
[Wed Oct 28 12:55:53 2015] [warn] [client 112.134.80.183] mod_fcgid: stderr: PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/3.0/no DST' instead in /home/buydesign/public_html/index.php on line 1
[Wed Oct 28 12:59:14 2015] [warn] [client 61.135.190.71] mod_fcgid: stderr: PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/3.0/no DST' instead in /home/buydesign/public_html/index.php on line 1, referer: http://www.baidu.com/s?wd=www
[Wed Oct 28 12:59:32 2015] [warn] [client 112.134.80.183] mod_fcgid: stderr: PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/3.0/no DST' instead in /home/buydesign/public_html/index.php on line 1
[Wed Oct 28 13:06:13 2015] [warn] [client 112.134.80.183] mod_fcgid: stderr: PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/3.0/no DST' instead in /home/buydesign/public_html/index.php on line 1
[Wed Oct 28 13:41:13 2015] [warn] [client 112.134.80.183] mod_fcgid: stderr: PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/3.0/no DST' instead in /home/buydesign/public_html/index.php on line 1
[Wed Oct 28 14:01:37 2015] [error] [client 66.249.69.6] File does not exist: /home/buydesign/public_html/robots.txt
[Wed Oct 28 14:01:38 2015] [error] [client 66.249.69.126] File does not exist: /home/buydesign/public_html/m
[Wed Oct 28 14:17:13 2015] [warn] [client 61.135.190.69] mod_fcgid: stderr: PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/3.0/no DST' instead in /home/buydesign/public_html/index.php on line 1, referer: http://www.baidu.com/s?wd=www
[Wed Oct 28 15:53:16 2015] [warn] [client 112.134.80.183] mod_fcgid: stderr: PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/3.0/no DST' instead in /home/buydesign/public_html/index.php on line 1
[Wed Oct 28 15:53:17 2015] [error] [client 112.134.80.183] File does not exist: /home/buydesign/public_html/favicon.ico
[Wed Oct 28 15:53:17 2015] [error] [client 112.134.80.183] File does not exist: /home/buydesign/public_html/favicon.ico
[Wed Oct 28 16:20:59 2015] [error] [client 66.249.69.126] File does not exist: /home/buydesign/public_html/mobile
Wed, 10/28/2015 - 10:16
andreychek

Howdy,

Just to verify, does running the phpinfo script work?

If so, then it looks like the issue is a PHP syntax error on line 3 of your index.php file, as seen here:

[Wed Oct 28 11:04:37 2015] [warn] [client 104.171.122.98] mod_fcgid: stderr: PHP Parse error:  syntax error, unexpected T_STRING, expecting ',' or ';' in /home/buydesign/public_html/index.php on line 3

If even the phpinfo file doesn't work, then you may want to set the timezone settings you see in the logs there, that can be set in $HOME/etc/php.ini.

-Eric

Wed, 10/28/2015 - 10:29
xdude

Yes it's working. I was wondering that and double checked the file and couldn't find anything on line. It has only one line which is

<?php
  phpinfo();
?>

maybe that php at start was the reason for that error.

Also how do sort this timezone error ?

PS : When I removed php next to <? then whole file goes blank white.

Wed, 10/28/2015 - 10:32
xdude

I mean at php.ini should I just put as

date.timezone = America/Los_Angeles

?

Wed, 10/28/2015 - 10:42
xdude

I changed the php.ini through Virtualmin but after restarting Apache I didn't see changes in info page.

Wed, 10/28/2015 - 11:09
andreychek

Howdy,

For now try editing $HOME/etc/php.ini directly using a text editor, and see if that resolves your issue.

-Eric

Wed, 10/28/2015 - 11:21
xdude

I'll give it a try.

But before I tried to do that for open_basedir and that didn't work either. I wonder if there is another ini file ?

Wed, 10/28/2015 - 11:52
xdude

Okey there must be another ini file because when i accessed to /etc/php.ini from ssh I can see the change there. But phpinfo doesn't show the change.

Wed, 10/28/2015 - 12:11
andreychek

The changes you want to make are in $HOME/etc/php.ini. Not /etc/php.ini, but in the user's homedir, within the etc/php.ini file there.

-Eric

Wed, 10/28/2015 - 12:43
xdude

I changed this home/buydesign/etc/php.ini

Now ini display correct values. but still php pages are blank and even in ini page if I remove php after <? (its like

<?php
 phpinfo
?>

) it goes blank.

still getting timezone error too.

Apache log

[Wed Oct 28 19:55:29 2015] [warn] [client 184.185.133.170] mod_fcgid: stderr: PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/3.0/no DST' instead in /home/buydesign/public_html/index.php on line 1
[Wed Oct 28 19:56:14 2015] [warn] [client 184.185.133.170] mod_fcgid: stderr: PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/3.0/no DST' instead in /home/buydesign/public_html/index.php on line 1
[Wed Oct 28 19:57:00 2015] [warn] [client 184.185.133.170] mod_fcgid: stderr: PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/3.0/no DST' instead in /home/buydesign/public_html/index.php on line 1
[Wed Oct 28 19:57:45 2015] [warn] [client 184.185.133.170] mod_fcgid: stderr: PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/3.0/no DST' instead in /home/buydesign/public_html/index.php on line 1
[Wed Oct 28 19:58:30 2015] [warn] [client 184.185.133.170] mod_fcgid: stderr: PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/3.0/no DST' instead in /home/buydesign/public_html/index.php on line 1
[Wed Oct 28 19:59:15 2015] [warn] [client 184.185.133.170] mod_fcgid: stderr: PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/3.0/no DST' instead in /home/buydesign/public_html/index.php on line 1
[Wed Oct 28 20:00:00 2015] [warn] [client 184.185.133.170] mod_fcgid: stderr: PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/3.0/no DST' instead in /home/buydesign/public_html/index.php on line 1
[Wed Oct 28 20:00:46 2015] [warn] [client 184.185.133.170] mod_fcgid: stderr: PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/3.0/no DST' instead in /home/buydesign/public_html/index.php on line 1
[Wed Oct 28 20:01:31 2015] [warn] [client 184.185.133.170] mod_fcgid: stderr: PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/3.0/no DST' instead in /home/buydesign/public_html/index.php on line 1
[Wed Oct 28 20:02:16 2015] [warn] [client 184.185.133.170] mod_fcgid: stderr: PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/3.0/no DST' instead in /home/buydesign/public_html/index.php on line 1
[Wed Oct 28 20:03:01 2015] [warn] [client 184.185.133.170] mod_fcgid: stderr: PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/3.0/no DST' instead in /home/buydesign/public_html/index.php on line 1
[Wed Oct 28 20:03:47 2015] [warn] [client 184.185.133.170] mod_fcgid: stderr: PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/3.0/no DST' instead in /home/buydesign/public_html/index.php on line 1
[Wed Oct 28 20:04:41 2015] [warn] [client 184.185.133.170] mod_fcgid: stderr: PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/3.0/no DST' instead in /home/buydesign/public_html/index.php on line 1
[Wed Oct 28 20:05:26 2015] [warn] [client 184.185.133.170] mod_fcgid: stderr: PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/3.0/no DST' instead in /home/buydesign/public_html/index.php on line 1
[Wed Oct 28 20:06:11 2015] [warn] [client 184.185.133.170] mod_fcgid: stderr: PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/3.0/no DST' instead in /home/buydesign/public_html/index.php on line 1
[Wed Oct 28 20:06:57 2015] [warn] [client 184.185.133.170] mod_fcgid: stderr: PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/3.0/no DST' instead in /home/buydesign/public_html/index.php on line 1
[Wed Oct 28 20:07:42 2015] [warn] [client 184.185.133.170] mod_fcgid: stderr: PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/3.0/no DST' instead in /home/buydesign/public_html/index.php on line 1
[Wed Oct 28 20:08:27 2015] [warn] [client 184.185.133.170] mod_fcgid: stderr: PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/3.0/no DST' instead in /home/buydesign/public_html/index.php on line 1
[Wed Oct 28 20:09:12 2015] [warn] [client 184.185.133.170] mod_fcgid: stderr: PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/3.0/no DST' instead in /home/buydesign/public_html/index.php on line 1
[Wed Oct 28 20:19:15 2015] [warn] [client 112.134.80.183] mod_fcgid: stderr: PHP Parse error:  syntax error, unexpected T_STRING, expecting ',' or ';' in /home/buydesign/public_html/one.php on line 3
Wed, 10/28/2015 - 13:16
andreychek

The script "index.php" is showing timezone errors, and the script one.php is showing syntax errors.

Which of those is it you're trying to run at the moment?

In either case you'd want to make sure the timezone is set within $HOME/etc/php.ini.

-Eric

Wed, 10/28/2015 - 13:38
xdude

index.php has the phpinfo

one.php just has <? echo Hello World ; ?>

the domain name is buydesign.info you can see it phpinfo on home page now.

It has date.timezone = America/Los_Angeles

unless $HOME/etc/php.ini. = /buydesign/etc/php.ini it should correct.

How to I clear Apache log and check again ?

Wed, 10/28/2015 - 13:44
andreychek

Howdy,

You wouldn't really need to clear the Apache error log... just look at the time stamps. If you see new entries showing up, then they're still an issue.

However, the code in one.php does appear to have a syntax error.

You'd probably want to use something like this:

<?php "Hello World"; ?>

That is, the "Hello World" needs to be in quotes to be valid PHP syntax, though I usually recommend adding the "php" in the front as well.

Also, $HOME/etc/php.ini refers to "/home/USERNAME/etc/php.ini".

-Eric

Wed, 10/28/2015 - 13:57
xdude

Sorry for confusion "/home/USERNAME/etc/php.ini". is the one I have edited.

Now one.php works when I have <?php and if just <? I get blank page

Now these are the new errors.

[Wed Oct 28 21:07:29 2015] [error] [client 192.169.71.34] script not found or unable to stat: /home/buydesign/cgi-bin/php
[Wed Oct 28 21:07:29 2015] [error] [client 192.169.71.34] script not found or unable to stat: /home/buydesign/cgi-bin/php5
[Wed Oct 28 21:07:29 2015] [error] [client 192.169.71.34] script not found or unable to stat: /home/buydesign/cgi-bin/php-cgi
[Wed Oct 28 21:07:29 2015] [error] [client 192.169.71.34] script not found or unable to stat: /home/buydesign/cgi-bin/php.cgi
[Wed Oct 28 21:07:29 2015] [error] [client 192.169.71.34] script not found or unable to stat: /home/buydesign/cgi-bin/php4
Thu, 10/29/2015 - 02:31
xdude

Okey I got sorted the short tag problem too.

Now only problem is those Apache errors . ))

Thu, 10/29/2015 - 06:52
Diabolico
Diabolico's picture

Is 192.169.71.34 your IP address or from your server? If not then log files you c/p are attempts from bots to run exploiting scripts on your server. You should install mod_security with some other security software like fail2ban or CSF.

- I often come to the conclusion that my brain has too many tabs open. -
Failing at desktop publishing & graphic design since 1994.

Thu, 10/29/2015 - 13:23
xdude

I know which I must do but before that I have to get the server up and running. got most of the things sorted now there is one thing.

right now I use 1 ip for both name servers but I do have 2. How to do I configure the second ip to ns2.domain.com ?

Thu, 10/29/2015 - 15:01
andreychek

Howdy,

Do you plan on having just one nameserver, with both nameserver IP's pointing at the same server?

If so, you could just keep things the way they are, there's no need to separate the two. The registrars I've used recently don't seem to have a problem with that particular setup.

The only reason you'd need to separate them is if you plan on setting up a second server to act as a secondary nameserver.

-Eric

Thu, 10/29/2015 - 20:39
xdude

I would like to use the second ip too. just to act as ns1 = ip1 and ns2 = ip2. ))

Topic locked