geekme Posted June 22, 2011 Share Posted June 22, 2011 I work on ubuntu 10.10.have installed apache2 and php5 using terminal but when i created a .php file( <?php phpinfo(); ?> ) and tried opening in my browser by giving the url :localhost/info.php it pops up the widow asking " Do you want to open or save the file".If I choose open it asks " Which application do you want to open with?" Please help [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/240064-opening-php-file-in-browser/ Share on other sites More sharing options...
fugix Posted June 22, 2011 Share Posted June 22, 2011 Have you reset your apache sever after installing php5 Quote Link to comment https://forums.phpfreaks.com/topic/240064-opening-php-file-in-browser/#findComment-1233146 Share on other sites More sharing options...
geekme Posted June 22, 2011 Author Share Posted June 22, 2011 How does one reset Apache? I remember giving some apache restart command on the terminal, is that it? Quote Link to comment https://forums.phpfreaks.com/topic/240064-opening-php-file-in-browser/#findComment-1233279 Share on other sites More sharing options...
fugix Posted June 22, 2011 Share Posted June 22, 2011 Yes you can redstart your apache server using the shell command. sudo /etc/init.d/apache2 restart Quote Link to comment https://forums.phpfreaks.com/topic/240064-opening-php-file-in-browser/#findComment-1233397 Share on other sites More sharing options...
geekme Posted June 22, 2011 Author Share Posted June 22, 2011 Yeah have done that too...but no help Quote Link to comment https://forums.phpfreaks.com/topic/240064-opening-php-file-in-browser/#findComment-1233418 Share on other sites More sharing options...
fugix Posted June 22, 2011 Share Posted June 22, 2011 The message that you reveive tells me that you do not have php properly installed on your localhost server. What directory do you have your php file in Quote Link to comment https://forums.phpfreaks.com/topic/240064-opening-php-file-in-browser/#findComment-1233425 Share on other sites More sharing options...
geekme Posted June 22, 2011 Author Share Posted June 22, 2011 beg your pardon but I simply wrote sudo apt-get install php and now when I write php -v..the terminal gives a complete info about the version of php installed , doesnt this mean that php is installed properly, moreover how do I figure out the location/dir having php? Quote Link to comment https://forums.phpfreaks.com/topic/240064-opening-php-file-in-browser/#findComment-1233438 Share on other sites More sharing options...
fugix Posted June 22, 2011 Share Posted June 22, 2011 You need to save your php files into your localhost www file. Should be located at /var/www Quote Link to comment https://forums.phpfreaks.com/topic/240064-opening-php-file-in-browser/#findComment-1233446 Share on other sites More sharing options...
geekme Posted June 22, 2011 Author Share Posted June 22, 2011 Yup its at /var/www/info.php Quote Link to comment https://forums.phpfreaks.com/topic/240064-opening-php-file-in-browser/#findComment-1233451 Share on other sites More sharing options...
fugix Posted June 22, 2011 Share Posted June 22, 2011 You want to install libapache2-mod-php5 Refer here Quote Link to comment https://forums.phpfreaks.com/topic/240064-opening-php-file-in-browser/#findComment-1233459 Share on other sites More sharing options...
geekme Posted June 23, 2011 Author Share Posted June 23, 2011 Well the link that you providd was for ubuntu 6 and lower while I use 10 so is there any other way out..please help I'm badly stuck and have to run my php apps...please Quote Link to comment https://forums.phpfreaks.com/topic/240064-opening-php-file-in-browser/#findComment-1233673 Share on other sites More sharing options...
fugix Posted June 23, 2011 Share Posted June 23, 2011 http://www.howtoforge.com/ubuntu_lamp_for_newbies Quote Link to comment https://forums.phpfreaks.com/topic/240064-opening-php-file-in-browser/#findComment-1233685 Share on other sites More sharing options...
geekme Posted June 23, 2011 Author Share Posted June 23, 2011 I faced problem in the very first step of installing apache.After typing sudo apt-get install apache2 when i open the browser it instaed of showing apache default folder shows the screen( as attached) [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/240064-opening-php-file-in-browser/#findComment-1233734 Share on other sites More sharing options...
fugix Posted June 23, 2011 Share Posted June 23, 2011 What happens when you click on your phpinfo file? Do you have a file in your www directory labeled index Quote Link to comment https://forums.phpfreaks.com/topic/240064-opening-php-file-in-browser/#findComment-1233867 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.