php pages are always blank

15 posts / 0 new
Last post
#1 Fri, 07/17/2009 - 06:02
sven30

php pages are always blank

Everytime I install webmin+virtualmin via the install.sh script and then create a virtual server and put php files in there, the pages are always blank. It seems like php isn't compiled or something. I saw a post on this here but there wasn't really a solution to it that I could find. Any help would be greatly appreciated.

Fri, 07/17/2009 - 09:01
andreychek

Can you take a look in the Apache error log for that domain? It would be in $HOME/logs/error_log.

If PHP is throwing some sort of error, it should show up in there whenever you try to load the page.

Thanks!

-Eric

Fri, 07/17/2009 - 09:56
sven30

this is in my error log regarding php:

[Thu Jul 16 18:51:26 2009] [error] [client 74.83.223.254] PHP Notice: A session had already been started - ignoring session_start() in /home/streamendous/public_html/include/config.php on line 2 [Thu Jul 16 18:51:26 2009] [error] [client 74.83.223.254] PHP Notice: Use of undefined constant BASE_DIR - assumed 'BASE_DIR' in /home/streamendous/public_html/include/config.php on line 60 [Thu Jul 16 18:51:26 2009] [error] [client 74.83.223.254] PHP Notice: Use of undefined constant BASE_DIR - assumed 'BASE_DIR' in /home/streamendous/public_html/include/config.php on line 61 [Thu Jul 16 18:51:26 2009] [error] [client 74.83.223.254] PHP Notice: Use of undefined constant BASE_URL - assumed 'BASE_URL' in /home/streamendous/public_html/include/config.php on line 62 [Thu Jul 16 18:51:26 2009] [error] [client 74.83.223.254] PHP Notice: Use of undefined constant BASE_DIR - assumed 'BASE_DIR' in /home/streamendous/public_html/include/config.php on line 64 [Thu Jul 16 18:51:26 2009] [error] [client 74.83.223.254] PHP Notice: Use of undefined constant BASE_URL - assumed 'BASE_URL' in /home/streamendous/public_html/include/config.php on line 65 [Thu Jul 16 18:51:26 2009] [error] [client 74.83.223.254] PHP Notice: Use of undefined constant BASE_DIR - assumed 'BASE_DIR' in /home/streamendous/public_html/include/config.php on line 67 [Thu Jul 16 18:51:26 2009] [error] [client 74.83.223.254] PHP Notice: Use of undefined constant BASE_URL - assumed 'BASE_URL' in /home/streamendous/public_html/include/config.php on line 68 [Thu Jul 16 18:51:26 2009] [error] [client 74.83.223.254] PHP Notice: Use of undefined constant BASE_DIR - assumed 'BASE_DIR' in /home/streamendous/public_html/include/config.php on line 69 [Thu Jul 16 18:51:26 2009] [error] [client 74.83.223.254] PHP Notice: Use of undefined constant BASE_URL - assumed 'BASE_URL' in /home/streamendous/public_html/include/config.php on line 70 [Thu Jul 16 18:51:26 2009] [error] [client 74.83.223.254] PHP Notice: Use of undefined constant BASE_DIR - assumed 'BASE_DIR' in /home/streamendous/public_html/include/config.php on line 71 [Thu Jul 16 18:51:26 2009] [error] [client 74.83.223.254] PHP Notice: Use of undefined constant BASE_URL - assumed 'BASE_URL' in /home/streamendous/public_html/include/config.php on line 72 [Thu Jul 16 18:51:26 2009] [error] [client 74.83.223.254] PHP Notice: Use of undefined constant BASE_DIR - assumed 'BASE_DIR' in /home/streamendous/public_html/include/config.php on line 73 [Thu Jul 16 18:51:26 2009] [error] [client 74.83.223.254] PHP Notice: Use of undefined constant BASE_URL - assumed 'BASE_URL' in /home/streamendous/public_html/include/config.php on line 74 [Thu Jul 16 18:51:26 2009] [error] [client 74.83.223.254] PHP Notice: Use of undefined constant BASE_DIR - assumed 'BASE_DIR' in /home/streamendous/public_html/include/config.php on line 93 [Thu Jul 16 18:51:26 2009] [error] [client 74.83.223.254] PHP Warning: require_once(/home/youruser/public_html/smarty/libs/Smarty.class.php) [function.require-once]: failed to open stream: No such file or directory in /home/streamendous/public_html/include/config.php on line 93 [Thu Jul 16 18:51:26 2009] [error] [client 74.83.223.254] PHP Fatal error: require_once() [function.require]: Failed opening required '/home/youruser/public_html/smarty/libs/Smarty.class.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/streamendous/public_html/include/config.php on line 93 [Thu Jul 16 18:51:26 2009] [error] [client 74.83.223.254] File does not exist: /home/streamendous/public_html/favicon.ico [Thu Jul 16 18:51:29 2009] [error] [client 74.83.223.254] File does not exist: /home/streamendous/public_html/favicon.ico [Thu Jul 16 18:51:38 2009] [error] [client 74.83.223.254] PHP Notice: A session had already been started - ignoring session_start() in /home/streamendous/public_html/include/config.php on line 2 [Thu Jul 16 18:51:38 2009] [error] [client 74.83.223.254] PHP Notice: Use of undefined constant BASE_DIR - assumed 'BASE_DIR' in /home/streamendous/public_html/include/config.php on line 60 [Thu Jul 16 18:51:38 2009] [error] [client 74.83.223.254] PHP Notice: Use of undefined constant BASE_DIR - assumed 'BASE_DIR' in /home/streamendous/public_html/include/config.php on line 61 [Thu Jul 16 18:51:38 2009] [error] [client 74.83.223.254] PHP Notice: Use of undefined constant BASE_URL - assumed 'BASE_URL' in /home/streamendous/public_html/include/config.php on line 62 [Thu Jul 16 18:51:38 2009] [error] [client 74.83.223.254] PHP Notice: Use of undefined constant BASE_DIR - assumed 'BASE_DIR' in /home/streamendous/public_html/include/config.php on line 64 [Thu Jul 16 18:51:38 2009] [error] [client 74.83.223.254] PHP Notice: Use of undefined constant BASE_URL - assumed 'BASE_URL' in /home/streamendous/public_html/include/config.php on line 65 [Thu Jul 16 18:51:38 2009] [error] [client 74.83.223.254] PHP Notice: Use of undefined constant BASE_DIR - assumed 'BASE_DIR' in /home/streamendous/public_html/include/config.php on line 67 [Thu Jul 16 18:51:38 2009] [error] [client 74.83.223.254] PHP Notice: Use of undefined constant BASE_URL - assumed 'BASE_URL' in /home/streamendous/public_html/include/config.php on line 68 [Thu Jul 16 18:51:38 2009] [error] [client 74.83.223.254] PHP Notice: Use of undefined constant BASE_DIR - assumed 'BASE_DIR' in /home/streamendous/public_html/include/config.php on line 69 [Thu Jul 16 18:51:38 2009] [error] [client 74.83.223.254] PHP Notice: Use of undefined constant BASE_URL - assumed 'BASE_URL' in /home/streamendous/public_html/include/config.php on line 70 [Thu Jul 16 18:51:38 2009] [error] [client 74.83.223.254] PHP Notice: Use of undefined constant BASE_DIR - assumed 'BASE_DIR' in /home/streamendous/public_html/include/config.php on line 71 [Thu Jul 16 18:51:38 2009] [error] [client 74.83.223.254] PHP Notice: Use of undefined constant BASE_URL - assumed 'BASE_URL' in /home/streamendous/public_html/include/config.php on line 72 [Thu Jul 16 18:51:38 2009] [error] [client 74.83.223.254] PHP Notice: Use of undefined constant BASE_DIR - assumed 'BASE_DIR' in /home/streamendous/public_html/include/config.php on line 73 [Thu Jul 16 18:51:38 2009] [error] [client 74.83.223.254] PHP Notice: Use of undefined constant BASE_URL - assumed 'BASE_URL' in /home/streamendous/public_html/include/config.php on line 74 [Thu Jul 16 18:51:38 2009] [error] [client 74.83.223.254] PHP Notice: Use of undefined constant BASE_DIR - assumed 'BASE_DIR' in /home/streamendous/public_html/include/config.php on line 93 [Thu Jul 16 18:51:38 2009] [error] [client 74.83.223.254] PHP Warning: require_once(/home/youruser/public_html/smarty/libs/Smarty.class.php) [function.require-once]: failed to open stream: No such file or directory in /home/streamendous/public_html/include/config.php on line 93 [Thu Jul 16 18:51:38 2009] [error] [client 74.83.223.254] PHP Fatal error: require_once() [function.require]: Failed opening required '/home/youruser/public_html/smarty/libs/Smarty.class.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/streamendous/public_html/include/config.php on line 93 [Thu Jul 16 23:52:29 2009] [error] [client 216.83.111.25] PHP Notice: A session had already been started - ignoring session_start() in /home/streamendous/public_html/include/config.php on line 2 [Thu Jul 16 23:52:29 2009] [error] [client 216.83.111.25] PHP Notice: Use of undefined constant BASE_DIR - assumed 'BASE_DIR' in /home/streamendous/public_html/include/config.php on line 60 [Thu Jul 16 23:52:29 2009] [error] [client 216.83.111.25] PHP Notice: Use of undefined constant BASE_DIR - assumed 'BASE_DIR' in /home/streamendous/public_html/include/config.php on line 61 [Thu Jul 16 23:52:29 2009] [error] [client 216.83.111.25] PHP Notice: Use of undefined constant BASE_URL - assumed 'BASE_URL' in /home/streamendous/public_html/include/config.php on line 62 [Thu Jul 16 23:52:29 2009] [error] [client 216.83.111.25] PHP Notice: Use of undefined constant BASE_DIR - assumed 'BASE_DIR' in /home/streamendous/public_html/include/config.php on line 64 [Thu Jul 16 23:52:29 2009] [error] [client 216.83.111.25] PHP Notice: Use of undefined constant BASE_URL - assumed 'BASE_URL' in /home/streamendous/public_html/include/config.php on line 65 [Thu Jul 16 23:52:29 2009] [error] [client 216.83.111.25] PHP Notice: Use of undefined constant BASE_DIR - assumed 'BASE_DIR' in /home/streamendous/public_html/include/config.php on line 67 [Thu Jul 16 23:52:29 2009] [error] [client 216.83.111.25] PHP Notice: Use of undefined constant BASE_URL - assumed 'BASE_URL' in /home/streamendous/public_html/include/config.php on line 68 [Thu Jul 16 23:52:29 2009] [error] [client 216.83.111.25] PHP Notice: Use of undefined constant BASE_DIR - assumed 'BASE_DIR' in /home/streamendous/public_html/include/config.php on line 69 [Thu Jul 16 23:52:29 2009] [error] [client 216.83.111.25] PHP Notice: Use of undefined constant BASE_URL - assumed 'BASE_URL' in /home/streamendous/public_html/include/config.php on line 70 [Thu Jul 16 23:52:29 2009] [error] [client 216.83.111.25] PHP Notice: Use of undefined constant BASE_DIR - assumed 'BASE_DIR' in /home/streamendous/public_html/include/config.php on line 71 [Thu Jul 16 23:52:29 2009] [error] [client 216.83.111.25] PHP Notice: Use of undefined constant BASE_URL - assumed 'BASE_URL' in /home/streamendous/public_html/include/config.php on line 72 [Thu Jul 16 23:52:29 2009] [error] [client 216.83.111.25] PHP Notice: Use of undefined constant BASE_DIR - assumed 'BASE_DIR' in /home/streamendous/public_html/include/config.php on line 73 [Thu Jul 16 23:52:29 2009] [error] [client 216.83.111.25] PHP Notice: Use of undefined constant BASE_URL - assumed 'BASE_URL' in /home/streamendous/public_html/include/config.php on line 74 [Thu Jul 16 23:52:29 2009] [error] [client 216.83.111.25] PHP Notice: Use of undefined constant BASE_DIR - assumed 'BASE_DIR' in /home/streamendous/public_html/include/config.php on line 93 [Thu Jul 16 23:52:29 2009] [error] [client 216.83.111.25] PHP Warning: require_once(/home/youruser/public_html/smarty/libs/Smarty.class.php) [function.require-once]: failed to open stream: No such file or directory in /home/streamendous/public_html/include/config.php on line 93 [Thu Jul 16 23:52:29 2009] [error] [client 216.83.111.25] PHP Fatal error: require_once() [function.require]: Failed opening required '/home/youruser/public_html/smarty/libs/Smarty.class.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/streamendous/public_html/include/config.php on line 93

Fri, 07/17/2009 - 09:58
andreychek

Yeah, it looks like something is wrong with your script :-)

Try running a simpler program -- perhaps put something like this into a file called test.php:

<?php phpinfo(); ?>

That would output some PHP info if it works.

In regards to your program -- it looks like multiple things are going wrong. It looks like it's missing one or more dependencies (including the templating library called Smarty), and it looks like the app may require some configuration as well.

-Eric

Fri, 07/17/2009 - 10:11
sven30

Hey thanks Eric!

info is coming up for me so php is working.

after looking at the docs here's what I need to have it run in php. WHere do I add or edit these items?

PHP Configuration: safe_mode = off register_argc_argv = on open_basedir = (no value) output_buffering = on upload_max_filesize = 200M (recommended maximum video upload size in MB) post_max_size = 200M (recommended maximum video upload size in MB) 5) GD Library 2 or higher 6) FFmpeg (http://ffmpeg.mplayerhq.hu) 7) Mplayer + Mencoder (http://www.mplayerhq.hu/design7/dload.html) 8) flv2tool (http://inlet-media.de/flvtool2) 9) Libogg + Libvorbis (http://www.xiph.org/downloads) 10) LAME MP3 Encoder (http://lame.sourceforge.net) 11) CGI-BIN Access 12) Apache mod_rewrite Enabled 13) Must be able to run PHP from the command line (CLI) with exec() 14) Allowed execution of background processes with exec( binary > /dev/null & )

Fri, 07/17/2009 - 10:20
andreychek

Those are php.ini settings.

If you're using the GPL Virtualmin version, then the php.ini file would be the system file within /etc/ (the exact path depends on your distro).

If you're using the Pro version, php.ini is in $HOME/etc/php.ini for each Virtual Server.

Most of those items already exist (but with different values), so you'd want to look through the php.ini file and make edits to those existing items.

-Eric

Fri, 07/17/2009 - 10:22
andreychek

Oh, except for those last few, which are additional programs they're looking for you to install (mplayer, mencoder, lbogg, lame, and so forth). You'd want to find a version of those programs for your distribution.

-Eric

Fri, 07/17/2009 - 10:43 (Reply to #7)
sven30

Yeah, I'll have to look into that. i don't want to start a new subject, but is there a way to install these using yum? i'm running centos 5

Fri, 07/17/2009 - 10:48 (Reply to #8)
andreychek

Maybe :-)

I'm not sure which of the above are provided by CentOS -- you can do a search though, by typing this on the command line:

yum search PROGRAM_NAME

For example, you can type:

yum search mplayer

If you see a result, then you can run:

yum install MPLAYER_PACKAGE_NAME

If you don't, then that may mean CentOS doesn't provide that package, and you'd need to find an alternate repository who provides it, or compile it manually.

-Eric

Fri, 07/17/2009 - 10:49 (Reply to #9)
sven30

gotcha

Fri, 07/17/2009 - 10:22
sven30

ok, i edited /etc/php.ini saved it and rechecked phpinfo page and it didn't update. ie. I changed register_argc_argv=off to register_argc_argv=on and it's still listed as off in phpinfo. do i have to restart something to see the changes?

Fri, 07/17/2009 - 10:29
andreychek

If you're using mod_php, you'd need to restart Apache. CGI and FCGID dont' require a restart.

Otherwise, in the phpinfo output, it says what php.ini file(s) it's using; make sure that the one you're editing is the one that it's using :-)

-Eric

Fri, 07/17/2009 - 10:44 (Reply to #12)
sven30

Yes, restarting apache worked. This prog supposedly cannot work under cgi. That's what they told me anyway, so i'll keep it mod_php. is that ok, or does this make my box too vulnerable?

Fri, 07/17/2009 - 10:51 (Reply to #13)
andreychek

Using mod_php is less secure than CGI or FCGID with suexec on a multi-user system where you don't trust each user (or the scripts they're running), as it executes everything as the "apache" user, rather than the Virtual Server owner.

Whether it's "too" insecure is for you to decide :-)

The alternative is to setup CGI or FCGID with suexec support. That works out of the box on the Pro version. Details on setting that up on the GPL version are here:

https://www.virtualmin.com/node/8462

Fri, 07/17/2009 - 19:24 (Reply to #14)
sven30

Cool

Topic locked