NO output on web browser

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
alanwhl
Forum Newbie
Posts: 5
Joined: Mon Mar 01, 2010 2:06 am

NO output on web browser

Post by alanwhl »

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
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: NO output on web browser

Post by VladSun »

Try

Code: Select all

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
alanwhl
Forum Newbie
Posts: 5
Joined: Mon Mar 01, 2010 2:06 am

Re: NO output on web browser

Post by alanwhl »

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
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Re: NO output on web browser

Post by s.dot »

Probably a parsing error.

Code: Select all

<? php
Should be:

Code: Select all

<?php
Remove the space.
Set Search Time - 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.
alanwhl
Forum Newbie
Posts: 5
Joined: Mon Mar 01, 2010 2:06 am

Re: NO output on web browser

Post by alanwhl »

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.
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: NO output on web browser

Post by VladSun »

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
alanwhl
Forum Newbie
Posts: 5
Joined: Mon Mar 01, 2010 2:06 am

Re: NO output on web browser

Post by alanwhl »

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?
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: NO output on web browser

Post by VladSun »

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
alanwhl
Forum Newbie
Posts: 5
Joined: Mon Mar 01, 2010 2:06 am

Re: NO output on web browser

Post by alanwhl »

Thanks for the reply. then i should find another way to run this..
Thanks again :)
29DesMcKadedra
Forum Newbie
Posts: 1
Joined: Mon Feb 21, 2011 1:00 am

Re: NO output on web browser

Post by 29DesMcKadedra »

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 free seo with seo services
Post Reply