LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 09-09-2005, 02:29 PM   #1
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,638

Rep: Reputation: 46
Help to run the PHP program I installed


I have downloaded the following file to install PHP on my system. I am using Mandrake Linux 10.0.

php-4.4.0.tar.gz

I successfully decompressed the file using '' tar -zxvf php-4.4.0.tar.gz
It created a lot of files and folders.

Afterwards, I moved into the following directory.

[root@c83-250-89-72 ka]# cd php-4.4.0/
[root@c83-250-89-72 php-4.4.0]#


-------------------------------------------------------------------------
Then I ran the '' ./install '' command and it was successful.

[root@c83-250-89-72 php-4.4.0]# ./configure
creating cache ./config.cache
checking host system type... i686-pc-linux-gnu
checking for gcc... gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking whether gcc and cc understand -c and -o together... yes
checking how to run the C preprocessor... gcc -E
checking for AIX... no
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking for re2c... exit 0;
checking whether ln -s works... yes


Configuring SAPI modules
checking for AOLserver support... no
checking for Apache 1.x module support via DSO through APXS... no

Running system checks
checking for missing declarations of reentrant functions... done
checking for sendmail... /usr/sbin/sendmail
checking whether system uses EBCDIC... no
checking for socket... yes


General settings
checking whether to include debugging symbols... no
checking layout of installed files... PHP
checking path to configuration file... DEFAULT


Configuring extensions
checking for OpenSSL support... no
checking for Kerberos support... no
checking for ZLIB support... no


Configuring PEAR
checking whether to install PEAR... yes

Configuring Zend
checking bison version... 1.875 (ok)
checking for inttypes.h... (cached) yes
checking for stdint.h... (cached) yes
checking for limits.h... (cached) yes

Configuring TSRM
checking for stdarg.h... (cached) yes

Configuring libtool
checking for Cygwin environment... no
checking for mingw32 environment... no
checking build system type... i686-pc-linux-gnu
checking for ld used by GCC... /usr/bin/ld

Generating files
updating cache ./config.cache
creating ./config.status
creating php4.spec
creating main/build-defs.h
creating scripts/phpize

[ The above list is incomplete. I didn't paste all the files. I just pasted some of them.]







How do I run the program now?
 
Old 09-09-2005, 02:48 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
Once you configured it, did you compile and install it?
 
Old 09-09-2005, 03:00 PM   #3
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,638

Original Poster
Rep: Reputation: 46
Thanks david_ross

I have never ever worked with PHP. I am new to PHP. Nowadays I am studying a course on Webdesign. I thought it would be ideal to learn some PHP too.

How do I compile it? Could you give me a lead?
 
Old 09-09-2005, 03:14 PM   #4
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,638

Original Poster
Rep: Reputation: 46
Yes, I ran the command ' make ' . It worked beautifully and at the end I got the following message.

Build complete.
(It is safe to ignore warnings about tempnam and tmpnam).

[root@c83-250-89-72 php-4.4.0]#


Afterwards, I ran the command ' make install ' command. It too worked beautifully.


[root@c83-250-89-72 php-4.4.0]# make install
Installing PHP SAPI module: cgi
Installing PHP CGI into: /usr/local/bin/
Installing PEAR environment: /usr/local/lib/php/
[PEAR] Archive_Tar - already installed: 1.1
[PEAR] Console_Getopt - already installed: 1.2
[PEAR] PEAR - already installed: 1.3.5
Wrote PEAR system config file at: /usr/local/etc/pear.conf
You may want to add: /usr/local/lib/php to your php.ini include_path
[PEAR] HTML_Template_IT- already installed: 1.1
[PEAR] Net_UserAgent_Detect- already installed: 2.0.1
[PEAR] XML_RPC - upgraded: 1.3.1
Installing build environment: /usr/local/lib/php/build/
Installing header files: /usr/local/include/php/
Installing helper programs: /usr/local/bin/
program: phpize
program: php-config
Installing man pages: /usr/local/man/man1/
page: phpize.1
page: php-config.1
[root@c83-250-89-72 php-4.4.0]#



[ Now I think this is done and I am in the business. How do I run the PHP program? If I just write a PHP program, will it work? ]

I know how to write a small program in HTML and run. I don't know about PHP.

Last edited by Gins; 09-09-2005 at 03:16 PM.
 
Old 09-09-2005, 03:34 PM   #5
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
Yes, you can create a php script now - try running this:
echo "<? phpinfo(); ?>" > phpinfo.php
php phpinfo.php

This should give you information about your php installation and environment.
 
Old 09-09-2005, 04:12 PM   #6
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,638

Original Poster
Rep: Reputation: 46
Thanks david_ross

It gave me a lot of data. Some of thema are as follows:

[root@c83-250-89-72 php-4.4.0]# echo "<? phpinfo(); ?>" > phpinfo.php
[root@c83-250-89-72 php-4.4.0]# php phpinfo.php
Content-type: text/html
X-Powered-By: PHP/4.4.0

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html><head>
<style type="text/css"><!--
body {background-color: #ffffff; color: #000000;}
body, td, th, h1, h2 {font-family: sans-serif;}
pre {margin: 0px; font-family: monospace;}
a:link {color: #000099; text-decoration: none; background-color: #ffffff;}
a:hover {text-decoration: underline;}
table {border-collapse: collapse;}
.center {text-align: center;}
.center table { margin-left: auto; margin-right: auto; text-align: left;}
.center th { text-align: center !important; }
td, th { border: 1px solid #000000; font-size: 75%; vertical-align: baseline;}
h1 {font-size: 150%;}
h2 {font-size: 125%;}
.p {text-align: left;}
.e {background-color: #ccccff; font-weight: bold; color: #000000;}
.h {background-color: #9999cc; font-weight: bold; color: #000000;}
.v {background-color: #cccccc; color: #000000;}
i {color: #666666; background-color: #cccccc;}
img {float: right; border: 0px;}
hr {width: 600px; background-color: #cccccc; border: 0px; height: 1px; color: #000000;}
//--></style>
<title>phpinfo()</title></head>
<body><div class="center">
<table border="0" cellpadding="3" width="600">
<tr class="h"><td>
<a href="http://www.php.net/"><img border="0" src="?=PHPE9568F34-D428-11d2-A769-00AA001ACF42" alt="PHP Logo" /></a><h1 class="p">PHP Version 4.4.0</h1>
</td></tr>
</table><br />
<table border="0" cellpadding="3" width="600">
<tr><td class="e">System </td><td class="v">Linux c83-250-89-72.bredband.comhem.se 2.6.3-7mdk #1 Wed Mar 17 15:56:42 CET 2004 i686 </td></tr>
<tr><td class="e">Build Date </td><td class="v">Sep 9 2005 21:10:29 </td></tr>
<tr><td class="e">Configure Command </td><td class="v"> './configure' </td></tr>
<tr><td class="e">Server API </td><td class="v">CGI </td></tr>
<tr><td class="e">Virtual Directory Support </td><td class="v">disabled </td></tr>
<tr><td class="e">Configuration File (php.ini) Path </td><td class="v">/usr/local/lib </td></tr>
<tr><td class="e">PHP API </td><td class="v">20020918 </td></tr>
<tr><td class="e">PHP Extension </td><td class="v">20020429 </td></tr>
<tr><td class="e">Zend Extension </td><td class="v">20050606 </td></tr>
<tr><td class="e">Debug Build </td><td class="v">no </td></tr>
<tr><td class="e">Zend Memory Manager </td><td class="v">enabled </td></tr>
<tr><td class="e">Thread Safety </td><td class="v">disabled </td></tr>
<tr><td class="e">Registered PHP Streams </td><td class="v">php, http, ftp </td></tr>
</table><br />
<table border="0" cellpadding="3" width="600">
<tr class="v"><td>


<tr><td class="e">safe_mode_include_dir</td><td class="v"><i>no value</i></td><td class="v"><i>no value</i></td></tr>
<tr><td class="e">sendmail_from</td><td class="v"><i>no value</i></td><td class="v"><i>no value</i></td></tr>
<tr><td class="e">sendmail_path</td><td class="v">/usr/sbin/sendmail&nbsp;-t&nbsp;-i&nbsp;</td><td class="v">/usr/sbin/sendmail&nbsp;-t&nbsp;-i&nbsp;</td></tr>
<tr><td class="e">serialize_precision</td><td class="v">100</td><td class="v">100</td></tr>
<tr><td class="e">short_open_tag</td><td class="v">On</td><td class="v">On</td></tr>
<tr><td class="e">SMTP</td><td class="v">localhost</td><td class="v">localhost</td></tr>
<tr><td class="e">smtp_port</td><td class="v">25</td><td class="v">25</td></tr>
<tr><td class="e">sql.safe_mode</td><td class="v">Off</td><td class="v">Off</td></tr>
<tr><td class="e">track_errors</td><td class="v">Off</td><td class="v">Off</td></tr>
<tr><td class="e">unserialize_callback_func</td><td class="v"><i>no value</i></td><td class="v"><i>no value</i></td></tr>
<tr><td class="e">upload_max_filesize</td><td class="v">2M</td><td class="v">2M</td></tr>
<tr><td class="e">upload_tmp_dir</td><td class="v"><i>no value</i></td><td class="v"><i>no value</i></td></tr>
<tr><td class="e">user_dir</td><td class="v"><i>no value</i></td><td class="v"><i>no value</i></td></tr>
<tr><td class="e">variables_order</td><td class="v"><i>no value</i></td><td class="v"><i>no value</i></td></tr>
<tr><td class="e">xmlrpc_error_number</td><td class="v">0</td><td class="v">0</td></tr>
<tr><td class="e">xmlrpc_errors</td><td class="v">Off</td><td class="v">Off</td></tr>
<tr><td class="e">y2k_compliance</td><td class="v">On</td><td class="v">On</td></tr>
</table><br />
<h2><a name="module_ctype">ctype</a></h2>
<table border="0" cellpadding="3" width="600">
<tr><td class="e">ctype functions </td><td class="v">enabled </td></tr>
</table><br />
<h2><a name="module_mysql">mysql</a></h2>
<table border="0" cellpadding="3" width="600">
<tr class="h"><th>MySQL Support</th><th>enabled</th></tr>
<tr><td class="e">Active Persistent Links </td><td class="v">0 </td></tr>
<tr><td class="e">Active Links </td><td class="v">0 </td></tr>
<tr><td class="e">Client API version </td><td class="v">3.23.49 </td></tr>
<tr><td class="e">MYSQL_MODULE_TYPE </td><td class="v">builtin </td></tr>
<tr><td class="e">MYSQL_SOCKET </td><td class="v">/var/lib/mysql/mysql.sock </td></tr>
<tr><td class="e">MYSQL_INCLUDE </td><td class="v"><i>no value</i> </td></tr>
<tr><td class="e">MYSQL_LIBS </td><td class="v"><i>no value</i> </td></tr>
</table><br />
<table border="0" cellpadding="3" width="600">
<tr class="h"><th>Directive</th><th>Local Value</th><th>Master Value</th></tr>
<tr><td class="e">mysql.allow_persistent</td><td class="v">On</td><td class="v">On</td></tr>
<tr><td class="e">mysql.connect_timeout</td><td class="v">60</td><td class="v">60</td></tr>
<tr><td class="e">mysql.default_host</td><td class="v"><i>no value</i></td><td class="v"><i>no value</i></td></tr>
<tr><td class="e">mysql.default_password</td><td class="v"><i>no value</i></td><td class="v"><i>no value</i></td></tr>
<tr><td class="e">mysql.default_port</td><td class="v"><i>no value</i></td><td class="v"><i>no value</i></td></tr>
<tr><td class="e">mysql.defau



<tr><td class="e">_ENV["DESKTOP"]</td><td class="v">kde</td></tr>
<tr><td class="e">_ENV["BROWSER"]</td><td class="v">kfmclient openProfile webbrowsing</td></tr>
<tr><td class="e">_ENV["DISPLAY"]</td><td class="v">:0.0</td></tr>
<tr><td class="e">_ENV["LC_TIME"]</td><td class="v">en_US</td></tr>
<tr><td class="e">_ENV["G_BROKEN_FILENAMES"]</td><td class="v">1</td></tr>
<tr><td class="e">_ENV["XAUTHORITY"]</td><td class="v">/root/.xauthylHLfg</td></tr>
<tr><td class="e">_ENV["LC_NAME"]</td><td class="v">sv_SE</td></tr>
<tr><td class="e">_ENV["COLORTERM"]</td><td class="v"><i>no value</i></td></tr>
<tr><td class="e">_ENV["_"]</td><td class="v">/usr/local/bin/php</td></tr>
<tr><td class="e">_ENV["OLDPWD"]</td><td class="v">/home/ka</td></tr>
</table><br />
<h2>PHP License</h2>
<table border="0" cellpadding="3" width="600">
<tr class="v"><td>
<p>
This program is free software; you can redistribute it and/or modify it under the terms of the PHP License as published by the PHP Group and included in the distribution in the file: LICENSE
</p>
<p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
</p>
<p>If you did not receive a copy of the PHP license, or have any questions about PHP licensing, please contact license@php.net.
</p>
</td></tr>
</table><br />
</div></body></html>[root@c83-250-89-72 php-4.4.0]#





I didn't paste everything here. What is the meaning of these data?
 
Old 09-09-2005, 04:54 PM   #7
JCipriani
Member
 
Registered: Aug 2005
Location: Pittsburgh, PA, USA
Distribution: Redhat 9, OS X 10.4.x, Win2K
Posts: 85

Rep: Reputation: 15
The php program that you ran will process a PHP page and output HTML data. The code that you see there is the HTML output of the PHP script. If you want to view it, you can do something like:
Code:
echo "<? phpinfo(); ?>" > phpinfo.php
php phpinfo.php > phpinfo.html
Then open phpinfo.html with your favorite web browser. If you want to set up an actual web server on your computer so that you can do things like browse to "http://localhost/something.php" (rather than going through the above process and opening the outputted.html files manually), you can set up your favorite web server and configure it to use /usr/local/bin/php as the CGI handler for .php files. Configuration depends on the web server you use. Apache is a good web server (you may even have it installed already if you installed it when you installed your OS, but you can download it) and PHP will actually run as an Apache module, in which case you don't need to mess with the CGI stuff. Apache is pretty well documented, and the PHP Apache plugin is as well.

Note that the echo command as used above is just creating a minimal PHP script and storing it in phpinfo.php. You wouldn't want to do that part with a PHP file that already exists, of course. But "php myphpfile.php > myphpfile.html" will do what you want.

But if you don't want to go through all the server stuff, you can do what I just did above: Use the php program to process the PHP script, save the output to a .html file, and open up the .html file in a web browser to view it.

Last edited by JCipriani; 09-09-2005 at 04:57 PM.
 
Old 09-09-2005, 05:01 PM   #8
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,638

Original Poster
Rep: Reputation: 46
Thanks JCipriani

It worked beautifully. Now I must go to bed. It is getting late in Europe. You are in the USA. It is not night yet in the USA.

I will do more work on this tomorrow and come back again when necessary.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to run a downloaded program after it has been installed. tzartman Linux - Software 3 08-13-2005 03:59 AM
installed a program with YaST, how do I run it? trempel Linux - Newbie 2 02-25-2005 06:59 PM
xdm failure to run a newly installed program ledatica Linux - Software 0 02-06-2005 05:39 PM
how to run installed program ? Viper Slackware 9 10-11-2003 05:19 PM
Viewing program messages when program isn't run from command line? Locura Linux - Software 1 09-27-2003 09:19 AM


All times are GMT -5. The time now is 09:58 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration