[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: PHP code won't run



On 6/21/2013 6:41 PM, Gary Roach wrote:
On 06/21/2013 02:58 PM, Jerry Stuckle wrote:
On 6/21/2013 5:37 PM, Gary Roach wrote:
On 06/21/2013 01:21 PM, Jerry Stuckle wrote:
On 6/21/2013 3:54 PM, Gary Roach wrote:
Not being able to find another mailing list that seems worthwhile I'm
hoping I can get a quick answer here. The following doesn't work.

System info:
wheezy
Apache2
php5
mySQL 5.?

My test web page:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" author="Gary L. Roach"/>
<title>PHP Information Page</title>
<!--<link href="uuclb.css" type="text/css" rel="stylesheet"
>-->
</head>
<body>
         echo "Test Message in body"
<?php
             echo "Test Message in PHP";
             //echo "phpinfo()";
         ?>
</body>
</html>

When run, the "Test Message in body" displays. The " Test Message in
PHP" does not.
Running ps xaf shows two instances of the apache server running.
Pasted
from the terminal:

    30541 ?        Ss     0:01 /usr/sbin/apache2 -k start
    30561 ?        S      0:00  \_ /usr/sbin/apache2 -k start
    30562 ?        S      0:00  \_ /usr/sbin/apache2 -k start

I've checked the installation of php5 and all seems well. You will
probably need additional information. Please ask.

Any help will be sincerely appreciated.

Gary R



Gary,

Does your web page have a .php extension?  What do you have in
/etc/apache2/mods-enabled?


The web page has an .html extension. Is a .php extension necessary if
there is PHP code mixed within html?

My mods-enable"
root@supercrunch:/etc/apache2/mods-enabled# ls
alias.conf                authz_groupfile.load   cgi.load
env.load               php5.conf            setenvif.load
alias.load                authz_host.load          deflate.conf
mime.conf           php5.load             status.conf
auth_basic.load      authz_user.load          deflate.load
mime.load            reqtimeout.conf   status.load
authn_file.load        autoindex.conf           dir.conf
negotiation.conf   reqtimeout.load
authz_default.load  autoindex.load           dir.load negotiation.load
setenvif.conf

Thanks for the help

Gary R.



By default, the server will only call the PHP interpreter for files
with a .php extension.  That can be changed in your httpd.conf file,
but that is not recommended (it will cause all pages, not just those
with a .php extension to be parsed, creating unnecessary workload).


When I put a .php extension on any of my files Apache can't seem to find
them. When I was working out of Blowfish earlier, and tried to display a
.php file on the browser, my system kept asking what to do with the
file. I finally told it to always use Apache2. So now the error doesn't
occur any more but the files still don't run. There must be something
fundamentally wrong with my setup. I wish I knew what it was. Below is
my index.html. Neither one of the links work. Below is my index.html
which calls phpinfo.php (listed above). The index file displays but does
nothing. The enterdb file works as far as the html part is concerned if
it has an html ending, but it's php calls don't do a thing.

    <!DOCTYPE html>
    <html>
         <head>
             <meta charset="utf-8" author="Gary L. Roach"/>
             <title>Index File</title>
             <link href="uuclb.css" type="text/css" rel="stylesheet" />
         </head>
    <body>
         <h1>Server Index</h1>
         <p>This is the default web page for this server.</p>
         <p><a href="file:///var/www/UUCLB_Project/enterdb.php"> Link to
    UUCLB Database </a></p>
         <p><a href="file:///var/www/phpinfo.php">Link to phpinfo()</a></p>
    </body>
    </html>


Gary R.


How are you loading the file? You MUST load it from a web server (i.e. http://localhost/index.php).


Reply to: