This question already has answers here:
PHP code is not being executed, but the code shows in the browser source code
(35 answers)
Closed 6 years ago.
Well, I am having problem while installing phpmyadmin to my linux system. I followed all the instruction from digital ocean. After, I verify it in the browser then it shows this kind of php code.
Did I miss something during my installation? My version of php is 7 and I am using ubuntu 14.04.
Its seems that your server(Apache) is not recognizing php script as PHP language to be executed. At first check whether PHP is enable or not by running the following command in your terminal:
a2query -m php7.0
If it says somathing like PHP is not enable then run the following command:
sudo a2enmod php7.0
Then restart your Apache2 server with the following command:
sudo service apache2 restart
Try refreshing the phpmyadmin page now. Hope this will solve your problem. Best of luck
After you install php for (I'm assuming) Apache you need to restart the webserver for it to read the config files.
Related
Recently i installed LAMP on Linux Mint. I successfully installed it and now just run this commands on terminal for checking the version :
apache2 -v
php -v
mysql -v
This is the result :
I dont have any problem with localhost because now i'm running phpinfo() function correctly and localhost (apache and php) is ok. but for database is that :
in orther to instal phpmyadmin you need to install mysql before cotinunig
so it said that MySQL is needed. as you see i had installed mySQL before and now i have problem with checking the version.
im trying to config phpmyadmin but here is:
so i think this is the cause of mySQL.
what is the problem ?
As the mysql extension is not part of a default PHP7 installation anymore (http://php.net/manual/de/mysql.php), you need to install it with
sudo apt-get install php-mysql
This should install and activate the mysql drivers. You will have to restart apache afterwards by
sudo service apache2 restart
If you have already the mysql package installed, check the php.ini under /etc/php/7.1/apache2/php.ini for the line
extension=mysql.so
Maybe phpmyadmin works with mysqli (extension=mysqli.so) too.
To install php7 and php5 in parallel, check out this guide:
http://lornajane.net/posts/2016/php-7-0-and-5-6-on-ubuntu
I have already solved this problem by searching for a long time.
Everytime for the first time you use mysql after you turn on the computer,you should execute the following sentence:
net start mysql80
80 is mysql's version.
Remember:you should run the cmd with administrator privileges
Best wishes!
This question already has answers here:
PHP code is not being executed, but the code shows in the browser source code
(35 answers)
Closed 6 years ago.
I have a problem with PHPMyAdmin login page on localhost. There is no login form, just a lot of gibberish, actually a lot of PHP code i don't understand.
screenshot
Installed LAMP several time with PHPMyAdmin, and always the same. LAMP is working fine, only PHPMyAdmin get this error. I m using Ubuntu 16.04...
Any suggestion will be appreciated.
The PHP is not executed, that's why we can see the source code of phpMyAdmin in your screenshot.
Try running this command :
sudo apt-get install php5 libapache2-mod-php5
sudo /etc/init.d/apache2 restart
this stackoverflow post should help you to activate php in your apache2 configuration
This question already has answers here:
How to enable PHP short tags?
(21 answers)
Closed 6 years ago.
I have installed nginx in ubuntu, and apparently have a newer version of php, which forces me to put <? Php in all websites if not read, I have a fairly large and serious system problem updating all as I can do to remove that restriction and using the simple <?
You can configure it on your php.ini. Nginx is not related, it is a web server.
Enable the short tag modifying your php.ini with this command
sudo nano /etc/php5/apache2/php.ini
and add this line
short_open_tag = On
Close nano and restart nginx with this command
sudo service nginx restart
This question already has answers here:
Browser ask me to download php file
(4 answers)
Closed 8 years ago.
I began following a tutorial about PHP. Reached the form handling. But here it is: when I do what they say and press Submit, it gives me to save the .php file instead of executing it? What am I missing here?
You are missing an HTTP server that supports PHP and is configured to use it. PHP (in the context on the WWW) is a server side technology.
You may not actually be running a web server, and instead may be simply loading local files in your web browser. Install an easy setup web server and PHP setup package. On Windows, WAMP is recommended. On MacOS, the equivalent is MAMP
Rather than opening files from your local drive, you then access them as (for example):
http://localhost/your_php_file.php
It is a misconfiguration of the server. Perhaps the recommendations here could help. Either PHP isn't installed or Apache was not configured.
You are missing the Apache server and required PHP installation.
If you are on windows. Go to this link Wamp and select Downloads and download the latest version of Wamp.
For Mac OS you can use Mamp
Download and install it in your machine.
If you are on Linux - Ubuntu you can do:
sudo apt-get install apache2
sudo apt-get install php5
sudo apt-get install libapache2-mod-php5
sudo /etc/init.d/apache2 restart
After installation place your php code in configured folder where the php is set to run and then go to browser and take the url : http://localhost/yourphp.file.
Hope this helps
I have a project that it is deploy and running on Debian (apache 2.2.9, php5.2, mysql 5.0)
Now i trying to run it in ubuntu 11.10(apache 2.2 php 5.3 mysql 5.1) but only the homepage is working.
If i click on any of the links I get the Not Found page:
Not Found
The requested URL /patients was not found on this server.
Does anybody have an idea why it is doing this?
I basically check everything, I can't figure out why.
I have a feeling it has to do with cakephp.
You need to enable mod_rewrite in Apache.
Run this command in terminal: sudo a2enmod rewrite, another I had to do for a fresh install was sudo a2enmod headers. Afterwards, you'll need to restart Apache, the terminal will tell you what command you have to run to do that.