PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Wed Sep 18, 2019 10:12 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: NO output on web browser
PostPosted: Mon Mar 01, 2010 3:13 am 
Offline
Forum Newbie

Joined: Mon Mar 01, 2010 3:06 am
Posts: 5
Hi, Im using Fedora 11, php 5.2.12, im trying to execute a Linux command by using php but the output doesnt echo on the web browser. Why? Is there anything i miss out? However i can run the same code in Windows

This is the sample code

<? php
$result = system ('whoami');
echo $result;
?>

i tried to replace system() with exec(), shell_exec(), passthru(), and also back tick (`) but still cant see the echo output. Need help!!
Thanks


Top
 Profile  
 
PostPosted: Mon Mar 01, 2010 7:25 am 
Offline
DevNet Master
User avatar

Joined: Wed Jun 27, 2007 9:44 am
Posts: 4313
Location: Sofia, Bulgaria
Try
Syntax: [ Download ] [ Hide ]
echo `whoami 2>&1`;

Also check your Apache error log files.

_________________
There are 10 types of people in this world, those who understand binary and those who don't


Top
 Profile  
 
PostPosted: Mon Mar 01, 2010 8:24 pm 
Offline
Forum Newbie

Joined: Mon Mar 01, 2010 3:06 am
Posts: 5
I made my thing become worst!!! I edit the user and group to root (testing purpose) and then after I change it back to the default user and group (apache),
my httpd now cant even detect .php file. It cant even echo "hello world". What had happened!!!?? :banghead:

i try to debug my code in eclipse and it give me "syntax error unexpected 'version'" on some files in visualisation folder.
ps: the visualisation folder was created when doing the GUI of the page by using flex in WINDOWS. I move the entire project from windows to Linux for now.

Any idea how can i solve this? I had tried to reinstall httpd and php in my machine, then add some line such as AddType application/x-httpd-php .php and
AddType application/x-httpd-php-source .phps into the httpd.conf but still cant get the result. It just come out a blank page when i run index.php


Top
 Profile  
 
PostPosted: Mon Mar 01, 2010 9:43 pm 
Offline
Tranquility In Moderation
User avatar

Joined: Sun Feb 06, 2005 8:18 pm
Posts: 5001
Location: Indiana
Probably a parsing error.

Syntax: [ Download ] [ Hide ]
<? php


Should be:
Syntax: [ Download ] [ Hide ]
<?php


Remove the space.

_________________
- A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.


Top
 Profile  
 
PostPosted: Tue Mar 02, 2010 8:38 pm 
Offline
Forum Newbie

Joined: Mon Mar 01, 2010 3:06 am
Posts: 5
Yes finally i solved the thing :D May be is because of the php-gtk extension. I removed it from the php.ini then everything is back to action hehe.

so now i can echo `whoami` but another question is can I execute linux application?? for example can i call Iagno from php??

like this?
<?php
system ('iagno');
?>

I try this but cannot work.


Top
 Profile  
 
PostPosted: Tue Mar 02, 2010 8:55 pm 
Offline
DevNet Master
User avatar

Joined: Wed Jun 27, 2007 9:44 am
Posts: 4313
Location: Sofia, Bulgaria
I think lagno isn't a console software, so I doubt you can simply "run" it from PHP. What are you trying to achieve in general?

_________________
There are 10 types of people in this world, those who understand binary and those who don't


Top
 Profile  
 
PostPosted: Tue Mar 02, 2010 9:15 pm 
Offline
Forum Newbie

Joined: Mon Mar 01, 2010 3:06 am
Posts: 5
I'm trying to execute an external program from php.
I had install gnome-ppp into my Linux and now trying to make a php site which can call this application.
How can i do that?


Top
 Profile  
 
PostPosted: Wed Mar 03, 2010 4:22 am 
Offline
DevNet Master
User avatar

Joined: Wed Jun 27, 2007 9:44 am
Posts: 4313
Location: Sofia, Bulgaria
Again, gnome-ppp is a desktop GUI application, it's not a console application. You can not call such applications from Apache PHP...
Also, I suppose you are trying to invoke the application at the client - if it's so, you should know that doing it with PHP is absolutely impossible.

_________________
There are 10 types of people in this world, those who understand binary and those who don't


Top
 Profile  
 
PostPosted: Wed Mar 03, 2010 4:50 am 
Offline
Forum Newbie

Joined: Mon Mar 01, 2010 3:06 am
Posts: 5
Thanks for the reply. then i should find another way to run this..
Thanks again :)


Top
 Profile  
 
PostPosted: Mon Feb 21, 2011 2:39 am 
Offline
Forum Newbie

Joined: Mon Feb 21, 2011 2:00 am
Posts: 1
Have you made you browser okay now? I’m sorry I have just recently registered. Anyway I have a friend that is expert in configuring the problem of a browser especially in linux. If you still need his help I can tell him to help you, so just in form me.



Try our with


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group