Page 1 of 1

NO output on web browser

Posted: Mon Mar 01, 2010 2:13 am
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

Re: NO output on web browser

Posted: Mon Mar 01, 2010 6:25 am
by VladSun
Try

Code: Select all

echo `whoami 2>&1`;
Also check your Apache error log files.

Re: NO output on web browser

Posted: Mon Mar 01, 2010 7:24 pm
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

Re: NO output on web browser

Posted: Mon Mar 01, 2010 8:43 pm
by s.dot
Probably a parsing error.

Code: Select all

<? php
Should be:

Code: Select all

<?php
Remove the space.

Re: NO output on web browser

Posted: Tue Mar 02, 2010 7:38 pm
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.

Re: NO output on web browser

Posted: Tue Mar 02, 2010 7:55 pm
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?

Re: NO output on web browser

Posted: Tue Mar 02, 2010 8:15 pm
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?

Re: NO output on web browser

Posted: Wed Mar 03, 2010 3:22 am
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.

Re: NO output on web browser

Posted: Wed Mar 03, 2010 3:50 am
by alanwhl
Thanks for the reply. then i should find another way to run this..
Thanks again :)

Re: NO output on web browser

Posted: Mon Feb 21, 2011 1:39 am
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