Sponsored Content
Top Forums Web Development Php script prints values but not seen in browser Post 302965021 by crimso on Friday 22nd of January 2016 09:34:13 AM
Old 01-22-2016
thank you all for replying.

akshay,
it didn't go unnoticed that the issue was likely pointing to the execution of dmidecode. i had already disabled selinux and even tried executing /usr/sbin/dmidecode with no luck. it didn't occur to me the command was being executed by apache and not root. so that's the issue, since dmidecode requires access to /dev/mem. so now i need to find a secure way for the apache user to execute dmidecode. or perhaps using sudo. not being a web admin or a php expert i'll have to dig in a little deeper. i suppose the short answer would be to "chmod 4755 /usr/sbin/dmidecode".

thanks.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Multiple PHP sessions within the same browser instance

Dear all..... I am currently writing a Help-Desk / Knowledge Base application using PHP/PostGreSQL. I authenticate the user using a quite elaborate mechanism of cookies. The problem is that using cookies (I also have a version using sessions with the same problem), I can only seem to get one... (4 Replies)
Discussion started by: zazzybob
4 Replies

2. Shell Programming and Scripting

Execute interactive bash menu script in browser with PHP

I have an interactive menu script written in bash and I would like use PHP to open the interactive bash menu in a browser. Is this possible? Using the sytem() function in php runs the script but it's all garbled. Seems like maybe a terminal window needs to be opened in php first? ... (1 Reply)
Discussion started by: nck
1 Replies

3. Shell Programming and Scripting

echo prints nothing-shell script

could anyone tell me why when i execute the following script, echo returns blank set k = 1 echo $k (9 Replies)
Discussion started by: saman_glorious
9 Replies

4. Shell Programming and Scripting

Execute shell script from browser through php

Hi all, I want to execute a shell script in which I call ssh to execute a remote command. Everything works fine from command line but when I try to call from PHP (with exec or whatever function) it fails. After some time I came to the root cause: when www-data execute the ssh command it asks... (4 Replies)
Discussion started by: Evan
4 Replies

5. Shell Programming and Scripting

Script that prints 2 messages to a screen session

Im trying to make a script that prints 2 messages to a screen session, one after the other. screen -x session44 -X stuff "`printf "Test 1\r"`" This works fine, but adding a second lien with a different message yields no results. Changed Subject: Please Follow Forum Rules Regarding... (1 Reply)
Discussion started by: kylecn
1 Replies

6. Emergency UNIX and Linux Support

Script issue - Prints pages with jibberish...

Hi all, I have a script from a programmer, for which I need to analyze a problem. The script gathers audit info and prints out the results. Two different departments use it, on two different printers. In the script department the there are no issues. In the other department the same script... (10 Replies)
Discussion started by: zixzix01
10 Replies

7. Shell Programming and Scripting

Shell script that check the argument passed to it and prints error if test condition is not met

I want to make a script that check for the argument passed to it and generates an error in case any character/string argument passed to it. I am using below code, but its not working. can anyone help. #!/bin/bash if ]; then echo 'An integer argument is passed to the script hence... (3 Replies)
Discussion started by: mukulverma2408
3 Replies

8. Shell Programming and Scripting

Script to compare 2 files and prints difference as output sidebyside

Hi All, Am trying script to compare 2 files and print the difference found from old file to new file on line by line basis on side by side display. Basically line by line comparision and files may contain blank line as well I know we have compare/diff commands but i don't how to make... (10 Replies)
Discussion started by: Optimus81
10 Replies

9. Shell Programming and Scripting

Script which telnets to a device, runs commands and prints output to a file

I am connecting to a device using telnet, I want my script to perform certain commands : ie- show device , show inventory..etc and write the output it sees from the terminal to a file. this is what I have got : #!/usr/bin/expect -- set running 1 spawn telnet <ip address> expect ... (1 Reply)
Discussion started by: samantha123
1 Replies
Parse::DMIDecode(3pm)					User Contributed Perl Documentation				     Parse::DMIDecode(3pm)

NAME
Parse::DMIDecode - Interface to SMBIOS using dmidecode SYNOPSIS
use strict; use Parse::DMIDecode (); my $decoder = new Parse::DMIDecode; $decoder->probe; # Actively probe using dmidecode # Manually supply your own dmidecode output to be parsed # $decoder->parse(qx(sudo /usr/sbin/dmidecode)); printf("System: %s, %s", $decoder->keyword("system-manufacturer"), $decoder->keyword("system-product-name"), ); DESCRIPTION
This module provides an OO interface to SMBIOS information through the dmidecode command which is known to work under a number of Linux, BSD and BeOS variants. METHODS
new my $decoder = Parse::DMIDecode->new( dmidecode => "/usr/sbin/dmidecode", nowarnings => 1, ); This is the constructor method to create a Parse::DMIDeocde object. It accepts two optional arguments; "dmidecode" and "nowarnings". The "dmidecode" argument specifies the full path and filename of the dmodecode command that should used by the "probe" method. The "nowarnings" argument instructs Parse::DMIDecode not to emit any parser warnings. probe $decoder->probe; This method executes an active probe to gather information using the dmidecode command. It does not accept any arguments. parse my $raw = qx(sudo /usr/sbin/dmidecode); $decoder->prase($raw); This method is a passive alternative to the "probe" method. It accepts a single string argument which should contain output from the dmidecode command, which it will parse. keyword my $serial_number = $decoder->keyword("system-serial-number"); keywords my @keywords = $decoder->keywords; my @bios_keywords = $decoder->keywords("bios"); for my $keyword (@bios_keywords) { printf("%s => %s ", $keyword, $decoder->keyword($keyword) ); } handle_addresses my @addresses = $decoder->handle_addresses; get_handles use Parse::DMIDecode::Constants qw(@TYPES); # Available groups to query: bios, system, baseboard, # chassis, processor, memory, cache, connector, slot for my $handle ($decoder->get_handles( group => "memory" )) { printf(">> Found handle at %s (%s): %s ", $handle->address, $TYPES[$handle->dmitype], $handle->raw ); } See Parse::DMIDecode::Handle for accessor method documentation for handle objects. smbios_version my $smbios_version = $decoder->smbios_version; Returns the SMBIOS version number. dmidecode_version my $dmidecode_version = $decoder->dmidecode_version; Returns the version number of the copy of dmidecode that was used to create the source data that was parsed. This value may not be available when using older versions of dmidecode. table_location my $memory_address = $decoder->table_location; structures my $total_structures = $decoder->structures; SEE ALSO
Parse::DMIDecode::Handle, Parse::DMIDecode::Constants, Parse::DMIDecode::Examples, examples/*.pl, <http://search.cpan.org/src/NICOLAW/Parse-DMIDecode-0.03/examples/>, <http://www.nongnu.org/dmidecode/>, <http://linux.dell.com/libsmbios/>, <http://sourceforge.net/projects/x86info/>, <http://www.dmtf.org/standards/smbios>, biosdecode(8), dmidecode(8), vpddecode(8) VERSION
$Id: DMIDecode.pm 1004 2007-03-11 12:43:25Z nicolaw $ AUTHOR
Nicola Worthington <nicolaw@cpan.org> <http://perlgirl.org.uk> If you like this software, why not show your appreciation by sending the author something nice from her Amazon wishlist ? <http://www.amazon.co.uk/gp/registry/1VZXC59ESWYK0?sort=priority> COPYRIGHT
Copyright 2006,2007 Nicola Worthington. This software is licensed under The Apache Software License, Version 2.0. <http://www.apache.org/licenses/LICENSE-2.0> perl v5.10.1 2009-12-02 Parse::DMIDecode(3pm)
All times are GMT -4. The time now is 02:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy