Apache http server dose not generate the "phpmyadmin" page - php

after installing the Apache http server and make sure it working.
Just added the folder of phpMyAdmin-4.2.0-english to the \Apache2\htdocs.
Renamed the folder to phpmyadmin.
while trying to view the page via http://localhost/phpmyadmin/index.php.
the page is not generated as php page.
all i can see is a textual page. (the index.php content as a text).
Did i miss anything? there is anything else i should install?

Try installing it using your package manager first. Once you get that to work, remove it and use the install you downloaded.
Assuming you're using Ubunutu/Debian:
$ sudo apt-get install apache2 php5 php5-mysql mysql-server phpmyadmin

Related

Apache2 cannot open .php files

I installed lamp long time ago and was able to execute php files. However, recently I tried to install cakePHP and ran into trouble (restarting apache started to generate errors). Thus I purged apache2 from my system. I reinstalled apache2 using command "apt-get install apache2" but after doing so it could no longer open .php files, shows a blank page instead. I've set the necessary permissions (given -R 777 to /etc and /var/www). I've also ran the command "apt-get install php7.0 libapache2-mod-php7.0" and restarted apache several times, nothing works. Can anyone help?
PS: I was originally trying to run phpmyadmin, before purging I was able to run it but after reinstalling it threw errors, thence I discovered my server was not able to execute any php file.
Additionally, when I access the file (home.php) via localhost/home.php it shows a blank page but if follow the path file:///var/www/html/home.php it brings a pop up that asks me to either save or open the script.
I think problem is the apache-php-mod is not well installed,I suggest you purge remove all apache and php package,then reinstall them.
sudo apt-get purge apache2
sudo apt-get purge php
sudo apt-get autoremove
Then,find all apache2 or php files, and remove them,you can do it by using find command,be carefully when do this!
sudo find / -name apache2
At last,you can reinstall them

Blank screen on my domain and automatic Zip download

when i try upload something on my domain ftp, blank screen appiers and automatic Zip download starts , even phpinfo not working. I have dedicated server and never had any problems
My domain is and i want to install script at http://fablefly.com/install
Can You look Guys ?
P.S i'm running Cpanel , php 5.2 , mysql , ion cube enabled.
I think I understand what you mean. I had the issue before when I set up my server and installed PHP, whenever I went to a page, it downloaded a useless file. I solved the issue by running the following commands via ssh.
sudo apt-get install libapache2-mod-php5
sudo a2enmod php5
sudo service apache2 restart
Not sure exactly how you would go about doing this via cpanel as I use webmin personally and do most of the work via command line. But I believe this is your issue.
See this page
http://serverkb.co.uk/wiki/PHP - the section titled "PHP Page downloading"
Check this out
http://cpanelhostingstuff.com/php-files-are-downloading-instead-of-executing/
Also look at some of these pages https://www.google.co.uk/#q=php+downloading+instead+of+executing+cpanel

http://localhost/phpmyadmin doesn't work

So, this is my problem. I have installed phpmyadmin via
sudo apt-get install phpmyadmin.
When I try to go "localhost/phpmyadmin", it downloads a file, called "download", without any explanation.
P.S. I have already installed LAMP before phpmyadmin.
Add the following line to /etc/apache2/apache2.conf
Include /etc/phpmyadmin/apache.conf
Or the path that is correct for your system. After restart apache.
I solved this problem. It was very noobian mistake.
I really forgot, that I was using suPHP instead the original PHP5. Now, I removed suPHP mode and enabled PHP5 and everything is working.
At my site, the dashboard of phpmyadmin didn't show up, but the php file that
would show up the dashboard. This was because,
I forgot to install the connection between apache and php:
apt-get install libapache2-mod-php
After doing it, it worked.

Codeigniter, URL Routing is failing

With a codeigniter codebase I've inherited, I'm attempting to get url routing up and running but it only seems to throw 404 errors.
When I go to http://root_url/index.php it hits the default controller/method just fine, however when I request any specifically controller/action, it 404s.
If I request http://root_url/index.php/auth/login apache throws
File does not exist: /var/www/ci_project/index.php/auth/login, referer: http://root_url/index.php
It looks like apache is trying to request a folder that obviously doesn't exist instead of supplying the uri segments of auth/login to the index.php
Notes:
I'm not using any htaccess file(the codebase should work without one)
mod_rewrite is enabled and is detected by php though I suspect the problem is occuring before hitting php
I'm using debian(w/ apache 2.2.2) as opposed to ubuntu(2.2.14) where it does work
Query string arguments work fine, it's just the URI segments
I'm not attempting to remove index.php, just get the basic controller url matching working
It actually turned out to be an apache configuration issue on debian and nothing particularly to do with codeigniter at all.
I did a purge/re-install of apache and that appeared to fix the issue.
sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common
sudo apt-get autoremove --purge
sudo apt-get install apache2
sudo apt-get install libapache2-mod-php5
My only guess as to why the problem occured is that I had
the libapache2-mod-php5filter(which I didn't realise till purging occured) instead of the libapache2-mod-php5 package installed and it simply didn't handle the urls correctly.
Thanks for the help.

Can't Install libcurl PHP on Ubuntu Linux

I am trying to use the new facebook api and it requires libcurl PHP. I used
sudo apt-get install php5-curl
sudo apachectl -k restart
And it didn't work. I get the same error and the phpinfo() page says nothing about libcurl.
The source of this problem is probably that I built some of the tools from source (apache2, php), but then I got bored so installed a lot of the extensions with the package manager. But I'm not exactly how to go about diagnosing the point of failure.
The apt-get install for curl definitely worked, and can be found in
/usr/lib/php5/20060613/curl.so
I think a lot of my confusion stems from not knowing which files go where, and what purpose they have. Any help would be appreciated, and please tell me if I need to provide more information.
edit:
The specific error I get is:
Exception: Facebook needs the CURL PHP extension.
from line
if (!function_exists('curl_init')) {
throw new Exception('Facebook needs the CURL PHP extension.');
}
Ubuntu: 9.10
PHP: 5.2.13
Loaded Configuration File: /etc/php5/apache2/php.ini
In general it's a bad idea to mix and match software from your distribution's package manager with stuff you've built yourself. The package manager will not know anything about the stuff you've built yourself and so can get confused.
Not only that but who's to say the stuff from the package manager is even binary compatible with the stuff you've built yourself? If you build it all yourself then at least you know it will all be compatible.
Sounds to me like you should uninstall the extensions and build them yourself. If you can't or don't want to do that then go back and install apache and friends through your package manager but I would recommend having patience and going for the former option.
Answer of Questions
What version of Ubuntu?
What version of PHP?
How is Apache and PHP set up?
What ini files does phpinfo() say is parsed? (should be near the top)
Perhaps apt failed to properly modify your php.ini file to load the curl extension?
Check out your php.ini and see if you have line like:
extension=curl.so
or maybe:
extension=/usr/lib/php5/20060613/curl.so
To check if php-curl is installed please follow these steps:
Create a file in your web server (in Ubuntu it would be in /var/www folder), name it info.php
Open that file and type this command:
<?php phpinfo(); ?>
Save that file
Open your favorite browser and open that file (ex: http://localhost/info.php)
Now you will see the Information about your PHP installation
Search for Curl, and if you cannot find it, it mean your php doesn’t have curl installed.
To install php-curl please follow these steps:
Open your terminal and type this command:
sudo apt-get install curl libcurl3 libcurl3-dev php5-curl php5-mcrypt
After it finish open php.ini file (mine is at /etc/php5/apache2/php.ini ) and add this command: extension=curl.so
Save the file and restart apache with this command:
/etc/init.d/apache2 restart
Check the PHP information page again, you will find PHP-CURL installed
That’s it
Source: http://www.ivankristianto.com/os/ubuntu/howto-install-curl-in-php-apache/379/

Categories