I can't get my main files to work..

ryanlee

Member
May 25, 2010
16
0
51
Okay, so I just got cpanel setup and whatnot..

I uploaded my forum, and for some reason I keep getting a blank page, my index.php files are in there but for some reason it's not reading it..

I don't even have a mysql database uploaded so it should be reading index.php and coming up cannot connect to database but it's not doing anything, it's a blank page.

I tried changing the main files to index.php in WHM

also I even created a new account, uploaded a plain index.php file yet I go to the site and it's going to a default page..

I can't figure out why it's doing this, any ideas?

also I edited some file and I keep getting this..

[email protected] [/home/]# service httpd restart
Warning: DocumentRoot [/dev/null] does not exist
[email protected] [/home/]#

Please can you help me figure this out..

thanks
 

ryanlee

Member
May 25, 2010
16
0
51
I even got this set

# DirectoryIndex is set via the WHM -> Service Configuration -> Apache Setup -> DirectoryIndex Priority
DirectoryIndex index.php index.html


that's in /usr/local/a/usr/local/apache/conf/httpd.conf

plus it shows correctly in whm.. i can't figure this out
 

madaboutlinux

Well-Known Member
Jan 24, 2005
1,051
2
168
Earth
You get a blank page because the index.php is not processed correctly and "display_errors" in php.ini must be disable. Edit the php.ini at

/usr/local/lib/php.ini
and set

display_errors = On
Save the file and restart the httpd service.

If you still see a blank page, run the index.php page manually via shell. SSH to your server as root and execute the index page as

php index.php
it will display the error message. You can also check the Apache error logs at

/usr/local/apache/logs/error_log
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,214
13
313
Houston, TX
cPanel Access Level
Root Administrator
In a cPanel/WHM environment, the proper way to restart Apache is to run:

/scripts/restartsrv_httpd

Just using service http restart will result in some things not happening (e.g. SSL-based websites not being brought back online).

Also, website files should be stored within in /home/username (substitute username with the cPanel user's username) - often within /home/username/public_html/, not /home/.

Check the cPanel user's home directory to see if there is an error_log file, it may help with the diagnosis.

Another error log you can check as a server administrator is:

/usr/local/apache/logs/error_log
 

ryanlee

Member
May 25, 2010
16
0
51
some reason it's reading the files from

/usr/local/apache/htdocs/index.html

instead of the home directory
 

ryanlee

Member
May 25, 2010
16
0
51
the weird thing is /http://scenecoderz.cc/~scenecod/
that works
 
Last edited by a moderator:

ryanlee

Member
May 25, 2010
16
0
51
I added index.php
with <php echo"hello wolrd"; ?>

and now i look at the error and this what it says..

[Wed May 26 00:10:54 2010] [error] [client 207.6.144.80] Premature end of script headers: index.php
[Wed May 26 00:11:01 2010] [error] [client 207.6.144.80] SoftException in Application.cpp:357: UID of script "/home/ryan/public_html/index.php" is smaller than min_uid
[Wed May 26 00:11:01 2010] [error] [client 207.6.144.80] Premature end of script headers: index.php
[Wed May 26 00:11:11 2010] [error] [client 97.84.134.243] SoftException in Application.cpp:357: UID of script "/home/ryan/public_html/index.php" is smaller than min_uid
[Wed May 26 00:11:11 2010] [error] [client 97.84.134.243] Premature end of script headers: index.php
[Wed May 26 00:11:12 2010] [error] [client 97.84.134.243] SoftException in Application.cpp:357: UID of script "/home/ryan/public_html/index.php" is smaller than min_uid
[Wed May 26 00:11:12 2010] [error] [client 97.84.134.243] Premature end of script headers: index.php
 

ryanlee

Member
May 25, 2010
16
0
51
Thanks everyone, I think it had to do with a problem with me editing files with root and it changed the permission
 

Spiral

BANNED
Jun 24, 2005
2,018
8
193
Thanks everyone, I think it had to do with a problem with me editing files with root and it changed the permission
Permission --- probably not so much.

Though you might of accidentally set some files to owner 'root' in which case you would definitely have problems running in your web browser