Getting PHP to work

Robert Meyer meyer_rm at yahoo.com
Mon Aug 4 19:24:47 EDT 2003


The problem is that you're trying to use shorthand tags for the PHP code.  If
you change the initial line to look like:
<?php phpinfo(); ?>
It should work.  I recommend doing this if you are writing new PHP code.  There
is a parameter in '/etc/php.ini' called 'short_open_tag' that can be changed to
yes to allow the <? tag to open PHP code but I don't recommend it unless you
have a lot of older code that uses the short tag and you don't have the time to
change it all.

Hope this helps...

Cheers!

Bob
--- Asheville Joe <josephj at main.nc.us> wrote:
> I'm trying to check out PHP.  I wrote the following file and named it 
> /home/bigbird/pgm/phpinfo.php
> 
> <? phpinfo(); ?>
> 
> I start Mozilla and enter file:///home/bigbird/pgm/phpinfo.php in the 
> address field and it displays the file as plain text (i.e. php is not 
> invoked).
> 
> I did a urpmi on php and it says all installed then
> 
> [root at localhost doc]# php -v
> PHP 4.3.1 (cli) (built: Feb 17 2003 14:34:15)
> Copyright (c) 1997-2002 The PHP Group
> Zend Engine v1.3.0, Copyright (c) 1998-2002 Zend Technologies
> 
> shows that it's there.
> 
> ps -ae shows
> 
>   PID TTY          TIME CMD
>     1 ?        00:00:04 init
>     2 ?        00:00:00 keventd
>     3 ?       ` 00:00:00 kapmd
>     4 ?        00:00:00 ksoftirqd_CPU0
>     5 ?        00:00:01 kswapd
>     6 ?        00:00:00 bdflush
>     7 ?        00:00:00 kupdated
>     8 ?        00:00:00 mdrecoveryd
>    12 ?        00:00:00 kjournald
>   123 ?        00:00:01 devfsd
>   218 ?        00:00:00 khubd
>   538 ?        00:00:00 kjournald
>   925 ?        00:00:00 portmap
>   941 ?        00:00:00 syslogd
>   949 ?        00:00:00 klogd
>   997 ?        00:00:00 rpc.statd
>  1014 ?        00:00:00 gpm
>  1127 ?        00:00:00 xfs
>  1169 ?        00:00:00 apmd
>  1202 ?        00:00:00 mdkkdm
>  1220 ?        00:01:22 X
>  1221 ?        00:00:00 atd
>  1235 ?        00:00:00 mdkkdm
>  1247 ?        00:00:00 saslauthd
>  1256 ?        00:00:00 saslauthd
>  1257 ?        00:00:00 saslauthd
>  1258 ?        00:00:00 saslauthd
>  1259 ?        00:00:00 saslauthd
>  1270 ?        00:00:06 python
>  1290 ?        00:00:00 tmdns
>  1319 ?        00:00:00 xinetd
>  1378 ?        00:00:00 cupsd
>  1406 ?        00:00:02 fam
>  1613 ?        00:00:00 master
>  1627 ?        00:00:00 pickup
>  1628 ?        00:00:00 nqmgr
>  1878 ?        00:00:00 httpd-perl
>  1885 ?        00:00:00 httpd-perl
>  1886 ?        00:00:00 httpd-perl
>  1887 ?        00:00:00 httpd-perl
>  1888 ?        00:00:00 httpd-perl
>  1894 ?        00:00:00 libhttpd.ep
>  1901 ?        00:00:00 advxsplitlogfil
>  1902 ?        00:00:00 libhttpd.ep
>  1903 ?        00:00:00 libhttpd.ep
>  1904 ?        00:00:00 libhttpd.ep
>  1905 ?        00:00:00 libhttpd.ep
>  1942 ?        00:00:00 crond
>  1967 ?        00:00:00 lisa
>  2088 vc/1     00:00:00 mingetty
>  2089 vc/2     00:00:00 mingetty
>  2090 vc/3     00:00:00 mingetty
>  2091 vc/4     00:00:00 mingetty
>  2092 vc/5     00:00:00 mingetty
>  2093 vc/6     00:00:00 mingetty
>  2338 ?        00:00:00 startkde
>  2425 ?        00:00:00 kdeinit
>  2428 ?        00:00:00 kdeinit
>  2431 ?        00:00:00 kdeinit
>  2433 ?        00:00:02 kdeinit
>  2442 ?        00:00:03 artsd
>  2444 ?        00:00:01 kdeinit
>  2445 ?        00:00:00 kwrapper
>  2447 ?        00:00:01 kdeinit
>  2448 ?        00:00:05 kdeinit
>  2450 ?        00:00:07 kdeinit
>  2453 ?        00:00:15 kdeinit
>  2458 ?        00:00:01 kweatherservice
>  2460 ?        00:00:01 kdeinit
>  2463 ?        00:00:01 kdeinit
>  2465 ?        00:00:02 kdeinit
>  2466 ?        00:00:01 korgac
>  2468 ?        00:00:02 kdeinit
>  2469 ?        00:00:02 kmoon
>  2474 ?        00:00:01 kalarmd
>  2477 ?        00:00:11 kdeinit
>  2502 pts/1    00:00:00 bash
>  2556 pts/1    00:00:00 su
>  2564 pts/1    00:00:00 bash
>  2640 ?        00:00:00 kdeinit
>  2702 ?        00:02:12 mozilla-bin
>  2709 ?        00:00:02 kppp
>  2710 ?        00:00:00 kppp
>  2712 ?        00:00:00 gconfd-2
>  2713 ?        00:00:00 mozilla-bin
>  2714 ?        00:00:00 mozilla-bin
>  2715 ?        00:00:00 mozilla-bin
>  2716 ?        00:00:00 mozilla-bin
>  2721 ?        00:00:00 mozilla-bin
>  2722 ttyS1    00:00:00 pppd
>  2767 ?        00:00:00 esd
>  2775 ?        00:00:09 kdeinit
>  2827 pts/1    00:00:00 gconfd-2
>  2840 pts/1    00:00:00 ps
> 
> I don't see plain hppd there, but Mandrake startup and shutdown always 
> mentions it.
> 
> So, what am I doing wrong?
> 
> The book I am reading says to put files in "your web server document 
> root" before running them, but I don't know what this means.
> 
> I tried changing the file to:
> 
> <HTML>
> <BODY>
> <? phpinfo(); ?>
> </BODY>
> </HTML>
> 
> and that displays a blank page.
> 
> TIA
> 
> Joe
> 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com



More information about the nflug mailing list