LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-25-2006, 04:46 PM   #1
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Rep: Reputation: 49
script to check instance of PHP & mySQL running on Unix platform


Hi,

Cany anyone tell me how to write a shell script which will check if the PHP is installed on the system and also mysql server deamon is running in the user account.

thanks
 
Old 04-25-2006, 11:04 PM   #2
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Original Poster
Rep: Reputation: 49
any one??
 
Old 04-26-2006, 05:05 PM   #3
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Original Poster
Rep: Reputation: 49
c'mon guys!!! Can anyone help me???
 
Old 04-26-2006, 05:30 PM   #4
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Start with:

php --version

ps -A | grep 'mysqld'
 
Old 04-26-2006, 05:54 PM   #5
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Original Poster
Rep: Reputation: 49
Thanks a lot buddy!!!

At least that will get me started....

If anyone has an already exisiting script which does that please post it. I will really appreciate that.
 
Old 04-26-2006, 07:10 PM   #6
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
"rpm -qa|grep -i php" and "rpm -qa|grep -i mysql" might also work, if your distro happens to be RPM-based (or "dpkg -l php*" for Apt-based distros) and you're not sure that PHP and/or mySQL are necessarily in the default path...

Last edited by paulsm4; 04-26-2006 at 07:13 PM.
 
Old 04-26-2006, 07:43 PM   #7
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Original Poster
Rep: Reputation: 49
Thanks...paulsm4

Actually I am on a Sun Solaris Unix System (5.9). And I am just a regular user on the system. I don't have access to root. Will the commands that you gave will still work?


Thanks
 
Old 04-26-2006, 09:40 PM   #8
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

No, but Solaris has its own package manager you can query (I vaguely recall it being called "admintool")

Your .. PSM
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I check to see if a script is running? slick_willie Programming 13 03-16-2007 10:18 AM
Executing UNIX command from PHP script ckoniecny Programming 3 03-01-2006 10:42 PM
to check instance of a script running kushalkoolwal Programming 14 02-23-2006 05:51 PM
php/mysql check varchar() xushi Programming 13 07-15-2005 11:20 AM
man.linuxquestions.org is running Apache/1.3.24 (Unix) PHP/4.2.0 rverlander LQ Suggestions & Feedback 3 09-08-2002 12:50 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:20 PM.

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