LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 04-18-2006, 03:25 AM   #16
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Original Poster
Rep: Reputation: 47

Thanks zqichik for the reply.

I tried your command even as a root user too. It was negative.


[nissanka@c83-250-111-43 ~]$ php -i
bash: php: command not found
[nissanka@c83-250-111-43 ~]$ su root
Password:
[root@c83-250-111-43 nissanka]# php -i
bash: php: command not found
[root@c83-250-111-43 nissanka]#


How do I try from a webpage?
 
Old 04-18-2006, 05:50 AM   #17
zaichik
Member
 
Registered: May 2004
Location: Iowa USA
Distribution: CentOS
Posts: 419

Rep: Reputation: 30
The easiest way is to write a script containing just the one line:

PHP Code:
<?php phpinfo(); ?>
Save that as test.php and put in the DocumentRoot directory of the webserver.

I can pretty much tell you right now it's not installed, though. The path to php ought to be /usr/bin or /usr/local/bin, or something that would be in the path of the root user.
 
Old 04-18-2006, 06:05 AM   #18
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Original Poster
Rep: Reputation: 47
Thanks zaichik for the reply.

[nissanka@c83-250-111-43 ~]$ cd /usr
[nissanka@c83-250-111-43 usr]$ cd local
[nissanka@c83-250-111-43 local]$ cd bin
[nissanka@c83-250-111-43 bin]$ ls
clamav-config* clamdscan* clamscan* freshclam* sigtool*
[nissanka@c83-250-111-43 bin]$

[This clamav means an anti-virus program.]

It seems there is no php in the directories you mentioned.

What do you mean by the Document Root directory of the webserver? I am trying this on my home computer. Where do I find the Root directory? Obviously, I can log in as a root user.

Please leave your comment here. I am leaving home soon for the gym and afterwards I will go to work. So I will attend this tomorrow. I will come home very late in the evening.
 
Old 04-18-2006, 06:17 AM   #19
zaichik
Member
 
Registered: May 2004
Location: Iowa USA
Distribution: CentOS
Posts: 419

Rep: Reputation: 30
This command:
Code:
which php
will tell you where PHP is installed, if at all. Again, I can all but guarantee you that it's not installed.

The DocumentRoot is the directory from which Apache will serve pages. You can find out what that is by finding your httpd.conf file and grepping for DocumentRoot:

locate -u
locate httpd.conf
grep DocumentRoot /path/to/httpd.conf

You'll get several lines of output, including one that looks like this:

DocumentRoot /usr/local/apache/htdocs

or maybe

DocumentRoot /var/www/html

That directory is the one from which Apache will serve douments. So (assuming the first DocumentRoot), if you put test.php in /usr/local/apache/htdocs, then /usr/local/apache/htdocs/test.php is served by Apache when you open http://<your IP address>/test.php in your browser.

Good luck.

Last edited by zaichik; 04-18-2006 at 06:18 AM.
 
Old 04-19-2006, 08:49 AM   #20
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Original Poster
Rep: Reputation: 47
It seems now I have installed and PHP and it is working. I am posting a part of the output I have received for the command '' php -i ''.

Please tell me whether I am correct.

[nissanka@c83-250-108-144 ~]$ php -i



phpinfo()
PHP Version => 5.0.4

System => Linux c83-250-108-144.bredband.comhem.se 2.6.12-12mdk #1 Fri Sep 9 17:26:56 CEST 2005 x86_64
Build Date => Mar 29 2006 17:33:10
Configure Command => This is irrelevant, look inside the /usr/share/doc/libphp5_common5-5.0.4/configure_command file. urpmi is your friend, use it to install extensions not shown below.
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /etc/php.ini
Scan this dir for additional .ini files => /etc/php.d
additional .ini files parsed => /etc/php.d/12_ctype.ini,
/etc/php.d/18_dom.ini,
/etc/php.d/22_ftp.ini,
/etc/php.d/24_gettext.ini,
/etc/php.d/36_mysql.ini,
/etc/php.d/41_pcre.ini,
/etc/php.d/43_posix.ini,
/etc/php.d/47_session.ini,
/etc/php.d/57_sysvsem.ini,
/etc/php.d/58_sysvshm.ini,
/etc/php.d/60_tokenizer.ini,
/etc/php.d/62_xml.ini,
/etc/php.d/62_xmlrpc.ini,
/etc/php.d/63_xsl.ini,
/etc/php.d/64_yaz.ini,
/etc/php.d/65_yp.ini,
/etc/php.d/A10_zip.ini

PHP API => 20031224
PHP Extension => 20041030
Zend Extension => 220040412
Debug Build => no
Thread Safety => disabled
IPv6 Support => enabled
Registered PHP Streams => php, file, http, ftp, compress.zlib, https, ftps
Registered Stream Socket Transports => tcp, udp, unix, udg, ssl, sslv3, sslv2, tls


This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.0.4-dev, Copyright (c) 1998-2004 Zend Technologies


_______________________________________________________________________


Configuration

PHP Core

Directive => Local Value => Master Value
allow_call_time_pass_reference => Off => Off
allow_url_fopen => On => On
always_populate_raw_post_data => Off => Off
arg_separator.input => & => &
arg_separator.output => & => &
asp_tags => Off => Off
auto_append_file => no value => no value
auto_globals_jit => On => On
auto_prepend_file => no value => no value
browscap => no value => no value
default_charset => no value => no value
default_mimetype => text/html => text/html
define_syslog_variables => Off => Off
disable_classes => no value => no value
disable_functions => no value => no value
display_errors => Off => Off
display_startup_errors => Off => Off
doc_root => no value => no value
docref_ext => no value => no value
docref_root => no value => no value
enable_dl => On => On
error_append_string => no value => no value
error_log => no value => no value
error_prepend_string => no value => no value
error_reporting => 2047 => 2047
expose_php => On => On
extension_dir => /usr/lib64/php/extensions => /usr/lib64/php/extensions
file_uploads => On => On
highlight.bg => #FFFFFF => #FFFFFF
highlight.comment => #FF8000 => #FF8000
highlight.default => #0000BB => #0000BB
highlight.html => #000000 => #000000
highlight.keyword => #007700 => #007700
highlight.string => #DD0000 => #DD0000
html_errors => Off => On
ignore_repeated_errors => Off => Off
ignore_repeated_source => Off => Off
ignore_user_abort => Off => Off
implicit_flush => On => Off
include_path => .:/usr/lib64/php/:/usr/share/pear/ => .:/usr/lib64/php/:/usr/share/pear/
log_errors => On => On
log_errors_max_len => 1024 => 1024
magic_quotes_gpc => Off => Off
magic_quotes_runtime => Off => Off
magic_quotes_sybase => Off => Off
mail.force_extra_parameters => no value => no value
max_execution_time => 0 => 30
max_input_time => 60 => 60
memory_limit => 32M => 32M
open_basedir => no value => no value
output_buffering => 0 => 4096
output_handler => no value => no value
post_max_size => 8M => 8M
precision => 14 => 14
register_argc_argv => On => Off
register_globals => Off => Off
register_long_arrays => On => On
report_memleaks => On => On
report_zend_debug => Off => Off
safe_mode => Off => Off
safe_mode_exec_dir => no value => no value
safe_mode_gid => Off => Off
safe_mode_include_dir => no value => no value
sendmail_from => me@localhost.com => me@localhost.com
sendmail_path => /usr/sbin/sendmail -t -i => /usr/sbin/sendmail -t -i
serialize_precision => 100 => 100
short_open_tag => On => On
SMTP => localhost => localhost
smtp_port => 25 => 25
sql.safe_mode => Off => Off
track_errors => Off => Off
unserialize_callback_func => no value => no value
upload_max_filesize => 2M => 2M
upload_tmp_dir => no value => no value
user_dir => no value => no value
variables_order => GPCS => GPCS
xmlrpc_error_number => 0 => 0
xmlrpc_errors => Off => Off
y2k_compliance => On => On
zend.ze1_compatibility_mode => Off => Off

ctype

ctype functions => enabled

dom

DOM/XML => enabled
DOM/XML API Version => 20031129
libxml Version => 2.6.20
HTML Support => enabled
XPath Support => enabled
XPointer Support => enabled
Schema Support => enabled
RelaxNG Support => enabled

ftp

FTP support => enabled

gettext

GetText Support => enabled

libxml

libXML support => active
libXML Version => 2.6.21
libXML streams => enabled

mysql

MySQL Support => enabled
Active Persistent Links => 0
Active Links => 0
Client API version => 4.1.12
MYSQL_MODULE_TYPE =>
MYSQL_SOCKET => /var/lib/mysql/mysql.sock
MYSQL_INCLUDE =>
MYSQL_LIBS =>

Directive => Local Value => Master Value
mysql.allow_persistent => On => On
mysql.connect_timeout => 60 => 60
mysql.default_host => no value => no value
mysql.default_password => no value => no value
mysql.default_port => no value => no value
mysql.default_socket => no value => no value
mysql.default_user => no value => no value
mysql.max_links => Unlimited => Unlimited
mysql.max_persistent => Unlimited => Unlimited
mysql.trace_mode => Off => Off

openssl

OpenSSL support => enabled
OpenSSL Version => OpenSSL 0.9.7g 11 Apr 2005

pcre

PCRE (Perl Compatible Regular Expressions) Support => enabled
PCRE Library Version => 6.3 15-Aug-2005

posix

Revision => $Revision: 1.60.2.2 $

session

Session Support => enabled
Registered save handlers => files user
Registered serializer handlers => php php_binary

Directive => Local Value => Master Value
session.auto_start => Off => Off
session.bug_compat_42 => On => On
session.bug_compat_warn => On => On
session.cache_expire => 180 => 180
session.cache_limiter => nocache => nocache
session.cookie_domain => no value => no value
session.cookie_lifetime => 0 => 0
session.cookie_path => / => /
session.cookie_secure => Off => Off
session.entropy_file => no value => no value
session.entropy_length => 0 => 0
session.gc_divisor => 100 => 100
session.gc_maxlifetime => 1440 => 1440
session.gc_probability => 1 => 1
session.hash_bits_per_character => 4 => 4
session.hash_function => 0 => 0
session.name => PHPSESSID => PHPSESSID
session.referer_check => no value => no value
session.save_handler => files => files
session.save_path => /tmp => /tmp
session.serialize_handler => php => php
session.use_cookies => On => On
session.use_only_cookies => Off => Off
session.use_trans_sid => 0 => 0

SPL

SPL support => enabled
Interfaces => RecursiveIterator, SeekableIterator
Classes => ArrayObject, ArrayIterator, CachingIterator, CachingRecursiveIterator, DirectoryIterator, FilterIterator, LimitIterator, ParentIterator, RecursiveDirectoryIterator, RecursiveIteratorIterator

standard

Regex Library => Bundled library enabled
Dynamic Library Support => enabled
Path to sendmail => /usr/sbin/sendmail -t -i

Directive => Local Value => Master Value
assert.active => 1 => 1
assert.bail => 0 => 0
assert.callback => no value => no value
assert.quiet_eval => 0 => 0
assert.warning => 1 => 1
auto_detect_line_endings => 0 => 0
date.default_latitude => 31.7667 => 31.7667
date.default_longitude => 35.2333 => 35.2333
date.sunrise_zenith => 90.83 => 90.83
date.sunset_zenith => 90.83 => 90.83
default_socket_timeout => 60 => 60
safe_mode_allowed_env_vars => PHP_ => PHP_
safe_mode_protected_env_vars => LD_LIBRARY_PATH => LD_LIBRARY_PATH
url_rewriter.tags => a=href,area=href,frame=src,input=src,form=,fieldset= => a=href,area=href,frame=src,input=src,form=,fieldset=
user_agent => no value => no value

tokenizer

Tokenizer Support => enabled

xml

XML Support => active
XML Namespace Support => active
EXPAT Version => expat_1.95.8

xmlrpc

core library version => xmlrpc-epi v. 0.51
php extension version => 0.51
author => Dan Libby
homepage => http://xmlrpc-epi.sourceforge.net
open sourced by => Epinions.com

xsl

XSL => enabled
libxslt Version => 1.1.15
libxslt compiled against libxml Version => 2.6.20
EXSLT => enabled
libexslt Version => 1.1.14

yaz

YAZ Support => enabled
PHP/YAZ Version => 1.0.2
YAZ Version => 2.1.4
Compiled with YAZ version => 2.1.4

yp
 
Old 04-19-2006, 08:51 AM   #21
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Original Poster
Rep: Reputation: 47
[nissanka@c83-250-108-144 ~]$ which php
/usr/bin/php
[nissanka@c83-250-108-144 ~]$

-----------------------------------------------

What is wrong with the following output?
[nissanka@c83-250-108-144 ~]$ locate -u
fatal error: locate: You are not authorized to create a default slocate database!
[nissanka@c83-250-108-144 ~]$ locate httpd.conf
warning: locate: warning: database /var/lib/slocate/slocate.db' is more than 8 days old
[nissanka@c83-250-108-144 ~]$

Last edited by Gins; 04-19-2006 at 08:55 AM.
 
Old 04-19-2006, 09:59 AM   #22
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
You probably need to be root..
 
Old 04-19-2006, 03:56 PM   #23
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Original Poster
Rep: Reputation: 47
Thanks Nylex for taking time to reply me.

Is the following fine?

Do I have working PHP?

How can I test?

This is my home computer. I don't have a network. I have already installed mysql. It works fine.


---------------------------------------------------------------------

[root@c83-250-108-144 nissanka]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 4.1.12

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> mysql - u root
->
 
Old 04-20-2006, 12:39 AM   #24
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
You already tested PHP and it appears to be working.
 
  


Reply



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
Is CUPS not installed by default? christopher5 Debian 1 06-19-2005 02:18 PM
is nslookup installed by default? mandrakewanta Linux - Networking 2 05-15-2005 02:16 PM
PHP Installed by default? delamatrix Slackware - Installation 4 11-30-2004 07:45 PM
What is the default folder where Apache is installed? johann519 Linux - Networking 3 01-22-2004 05:08 PM
Is lftp installed by default on... Coolrunr Linux - Software 3 09-30-2003 05:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:57 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration