Asked  1 Year ago    Answers:  5   Viewed   9 times

When calling the phpmyadmin website a "save file" dialog appears for application/x-httpd-php- so my server does not execute the phpmyadmin php script but transfers the code to my browser. Other php such as roundcube or ispconfig work as supposed.

  • I found a topic here that stated to enable short_open_tags in the php.ini but that did not help (i.e. it already was enabled by default).
  • Also, I checked to have installed and enabled the apache 2 php5 modules.
  • In the logs files obviously no errors are listed.
  • I wondered if the phpmyadmin.conf is even regarded, as only a symlink is pointing to /usr/share/phpmyadmin in the etc/apache2/conf.d/ directory, but since the Alias /phpmyadmin works, this is not the problem.
  • I checked the apache2 config files but could not find anything wrong.

Nevertheless I'd like to post some here: apache2.conf

<IfModule mpm_prefork_module>
    StartServers          5
    MinSpareServers       5
    MaxSpareServers      10
    MaxClients          150
    MaxRequestsPerChild   0
<IfModule mpm_worker_module>
    StartServers          2
    MinSpareThreads      25
    MaxSpareThreads      75
    ThreadLimit          64
    ThreadsPerChild      25
    MaxClients          150
    MaxRequestsPerChild   0
<IfModule mpm_event_module>
    StartServers          2
    MinSpareThreads      25
    MaxSpareThreads      75
    ThreadLimit          64
    ThreadsPerChild      25
    MaxClients          150
    MaxRequestsPerChild   0
AccessFileName .htaccess
<Files ~ "^.ht">
    Order allow,deny
    Deny from all
    Satisfy all
DefaultType None
HostnameLookups Off
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
Include mods-enabled/*.load
Include mods-enabled/*.conf
Include ports.conf
LogFormat "%v:%p %h %l %u %t "%r" %>s %O "%{Referer}i" "%{User-Agent}i"" vhost_combined
LogFormat "%h %l %u %t "%r" %>s %O "%{Referer}i" "%{User-Agent}i"" combined
LogFormat "%h %l %u %t "%r" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
Include conf.d/
Include sites-enabled/


Alias /phpmyadmin /usr/share/phpmyadmin
<Directory /usr/share/phpmyadmin>
        Options FollowSymLinks
        DirectoryIndex index.php
        <IfModule mod_php5.c>
                AddType application/x-httpd-php .php
                php_flag magic_quotes_gpc Off
                php_flag track_vars On
                php_flag register_globals Off
                php_admin_flag allow_url_fopen Off
                php_value include_path .
                php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
                php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/
<Directory /usr/share/phpmyadmin/setup>
    <IfModule mod_authn_file.c>
    AuthType Basic
    AuthName "phpMyAdmin Setup"
    AuthUserFile /etc/phpmyadmin/htpasswd.setup
    Require valid-user
<Directory /usr/share/phpmyadmin/libraries>
    Order Deny,Allow
    Deny from All
<Directory /usr/share/phpmyadmin/setup/lib>
    Order Deny,Allow
    Deny from All

These are the enabled apache 2 mods:

 actions alias auth_basic auth_digest authn_file authz_default authz_groupfile authz_host authz_user autoindex cgi dav dav_fs deflate dir env fcgid include mime negotiation php5 reqtimeout rewrite ruby setenvif ssl status suexec suphp

and the installed packages related to apache 2 or php:

ii  libapache2-mod-php5                  5.4.4-14                     i386         server-side, HTML-embedded scripting language (Apache 2 module)
ii  libapache2-mod-suphp                 0.7.1-3                      i386         Apache2 module to run PHP scripts with the owner permissions
ii  php-auth                             1.6.2-1                      all          PHP PEAR modules for creating an authentication system
ii  php-pear                             5.4.4-14                     all          PEAR - PHP Extension and Application Repository
ii  php5                                 5.4.4-14                     all          server-side, HTML-embedded scripting language (metapackage)
ii  php5-cgi                             5.4.4-14                     i386         server-side, HTML-embedded scripting language (CGI binary)
ii  php5-cli                             5.4.4-14                     i386         command-line interpreter for the php5 scripting language
ii  php5-common                          5.4.4-14                     i386         Common files for packages built from the php5 source
ii  php5-curl                            5.4.4-14                     i386         CURL module for php5
ii  php5-gd                              5.4.4-14                     i386         GD module for php5
ii  php5-imagick                         3.1.0~rc1-1+b2               i386         ImageMagick module for php5
ii  php5-imap                            5.4.4-14                     i386         IMAP module for php5
ii  php5-intl                            5.4.4-14                     i386         internationalisation module for php5
ii  php5-mcrypt                          5.4.4-14                     i386         MCrypt module for php5
ii  php5-mysql                           5.4.4-14                     i386         MySQL module for php5
ii  phpmyadmin                           4:                 all          MySQL web administration tool
ii  suphp-common                         0.7.1-3                      i386         Common files for mod suphp
ii  apache2                              2.2.22-13                    i386         Apache HTTP Server metapackage
ii  apache2-doc                          2.2.22-13                    all          Apache HTTP Server documentation
ii  apache2-mpm-prefork                  2.2.22-13                    i386         Apache HTTP Server - traditional non-threaded model
ii  apache2-suexec                       2.2.22-13                    i386         Standard suexec program for Apache 2 mod_suexec
ii  apache2-utils                        2.2.22-13                    i386         utility programs for webservers
ii  apache2.2-bin                        2.2.22-13                    i386         Apache HTTP Server common binary files
ii  apache2.2-common                     2.2.22-13                    i386         Apache HTTP Server common files
ii  libapache2-mod-fcgid                 1:2.3.6-1.2                  i386         an alternative module compat with mod_fastcgi
ii  libapache2-mod-php5                  5.4.4-14                     i386         server-side, HTML-embedded scripting language (Apache 2 module)
ii  libapache2-mod-ruby                  1.2.6-2                      i386         Embedding Ruby in the Apache2 web server
ii  libapache2-mod-suphp                 0.7.1-3                      i386         Apache2 module to run PHP scripts with the owner permissions

I am running out of ideas here. I need to mention, that I mistakenly upgraded directly from Debian 5 to Debian 7 which was a big pain and caused a lot of trouble. This current problem is part of it and there might be weird causes involved, such as depreciated config entries or whatever.



First of all, what is the version of PHP?

If other .php scripts work except for phpMyAdmin, the is pretty safe to assume something is wrong with phpMyAdmin installation. (either with the files or the Virtual Host)


  1. Can you run another script in phpMyAdmin directory? Try with a file containing phpinfo(); If it does not work then the problem is in your apache configuration.

  2. If the above is true, then the parser is not recognising phpMyAdmin/index.php as a php file, for some reason. Try reinstalling phpMyAdmin.


Remove AddType application/x-httpd-php .php. You should not need it.

In PHP 5.4 magic_quotes_gpc was removed. If you're running PHP5, remove that line.

As of PHP 4.0.3, track_vars is always turned on, so remove it also.

As of PHP 4.2.0, register_globals this directive defaults to off. In PHP5.3 register_globals is deprecated, as of PHP5.4 register_globals was removed. SO if running PHP > 4.2.0 remove that line.

Saturday, May 29, 2021

To use a Command in your scheduler, you can use it's signature, or it's Classname. Each Command in AppConsoleCommands has the following:

 * The name and signature of the console command.
 * @var string
protected $signature = "example:command";

Once the Command is imported into AppConsoleKernel.php, in the protected $commands = []; array, it can be used in the schedule() function, but using ExampleCommand::class isn't correct:

protected function schedule(Schedule $schedule){
  $schedule->command("example:command --force")->everyMinute();
  $schedule->command(ExampleCommand::class, ["--force"])->everyMinute();

The main issue here seems to be with the --force option throwing the following error:

"--force" option does not exist

Many of the existing Laravel commands have the --force flag set, which, from the documentation does the following:

Force the operation to run when in production.

Many artisan commands prompt for input when you run a command, like php artisan migrate, that asks

Are you sure you want to run this command in production?

Since the scheduler is non-interactive, the --force flag will override this prompt to "Yes". That all being said, you need to define and handle the option yourself:

protected $signature = "example:command {--force}";

public function handle(){
  $force = $this->option("force");
  if(env("APP_ENV", "production") == "production" && !$force){
    if(!$this->ask("Are you sure you want to run this in production?")){
      return false; // or dd();, etc.

This is untested, but if APP_ENV=production is set in .env, and $force is null (default if --force isn't included), then it will prompt for confirmation, and exit if "No" is answered.

Thursday, April 1, 2021

I had this and found that it was because the index.php file was set with encryption.

For anyone that wants to rule it out - right click the php file, select 'properties' then click the 'advanced' button and uncheck the 'Encrypt contents to secure data' check box and click 'O.K'. This worked for me, so just putting it out there.

Saturday, May 29, 2021

A better solution here is to change the config that controls phpMyAdmin and not the php.ini file.

If you change the php.ini file you effect everything in PHP and should you write that infinite loop that we all do from time to time it will take longer to terminate your infinite loop than is sensible.

Note: If you are using the 64bit WAMPServer the base folder name will be wamp64 instead of wamp so please amend the below folder names accordingly.

So change wampaliasphpmyadmin.conf. By default it will look something like this although your version of phpMyAdmin will probably be different:

Alias /phpmyadmin "c:/wamp/apps/phpmyadmin4.1.14/"

<Directory "c:/wamp/apps/phpmyadmin4.1.14/">
   Options Indexes FollowSymLinks MultiViews
   AllowOverride all
  <IfDefine APACHE24>
    Require local
  <IfDefine !APACHE24>
    Order Deny,Allow
      Deny from all
      Allow from localhost ::1
  php_admin_value upload_max_filesize 128M
  php_admin_value post_max_size 128M
  php_admin_value max_execution_time 360
  php_admin_value max_input_time 360

To extend the maximum time limit for importing a database, change the php_admin_value max_execution_time parameter. You may also need to change the other parameters as larger databases tend to come in larger files and take longer to read as well. Example:

  php_admin_value upload_max_filesize 1024M
  php_admin_value post_max_size 1024M
  php_admin_value max_execution_time 1800
  php_admin_value max_input_time 1800

Don't forget to restart Apache after making changes to this file.

Wednesday, June 23, 2021

check your php5-mysql php module if it is installed correctly (maybe you forgot apache restart?)

had the same issue and after checking php-mysql module again and fixing it, this error vanished

Saturday, August 7, 2021
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :