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] 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 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? 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 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 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 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? 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 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 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 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 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 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] 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 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
Archived
This topic is now archived and is closed to further replies.