LinuxQuestions.org
Visit Jeremy's Blog.
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 06-04-2010, 10:21 AM   #1
razzera
Member
 
Registered: Dec 2009
Posts: 105

Rep: Reputation: 15
systemcommand to php


Hello

With the command "tail -300 /var/log/apache2/access.log | less" i can look in the log for the 300 latest visitors from my logfile. and i wanted to ask if it's possiblle to get that command to run from a php file and if yes how ?? can someone please give an example on how i run system commands in php? i use debian if it matters.
 
Old 06-04-2010, 10:44 AM   #2
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,449

Rep: Reputation: 446Reputation: 446Reputation: 446Reputation: 446Reputation: 446
PHP Code:
header("Content-Type: text/plain");
passthru("tail -300 /var/log/apache2/access.log"); 
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting Error: Missing Dependency: php-common, when trying to install php-soap amish123 Linux - Software 3 02-18-2010 07:26 PM
php/shell script to install mysql,apache and php automatically stranger_6_7 Linux - General 2 08-11-2009 02:07 AM
Yesterday PHP worked just fine and today it wants to serve up the php code. orsty9001 Linux - Server 10 12-12-2008 10:48 AM
Php account verify email links back to php.org zenerdiode Linux - Server 3 10-03-2006 05:21 PM
php apache or php cgi - php learner rblampain Linux - Security 3 12-17-2004 11:10 PM

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

All times are GMT -5. The time now is 06:04 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