3

I recently installed TaskSel and phpMyAdmin on an Ubuntu 13.04 64bit setup. After the installation I tried to visit http://localhost/phpmyadmin and this is what comes up in the web page:

addJSON( 'options', PMA_RecentTable::getInstance()->getHtmlSelectOption() ); exit; } if ($GLOBALS['PMA_Config']->isGitRevision()) { if (isset($_REQUEST['git_revision']) && $GLOBALS['is_ajax_request'] == true) { PMA_printGitRevision(); exit; } echo '
'; } // Handles some variables that may have been sent by the calling script $GLOBALS['db'] = ''; $GLOBALS['table'] = ''; $show_query = '1'; // Any message to display? if (! empty($message)) { echo PMA_Util::getMessage($message); unset($message); } $common_url_query = PMA_generate_common_url('', ''); // when $server > 0, a server has been chosen so we can display // all MySQL-related information if ($server > 0) { include 'libraries/server_common.inc.php'; include 'libraries/StorageEngine.class.php'; // Use the verbose name of the server instead of the hostname // if a value is set $server_info = ''; if (! empty($cfg['Server']['verbose'])) { $server_info .= htmlspecialchars($cfg['Server']['verbose']); if ($GLOBALS['cfg']['ShowServerInfo']) { $server_info .= ' ('; } } if ($GLOBALS['cfg']['ShowServerInfo'] || empty($cfg['Server']['verbose'])) { $server_info .= PMA_DBI_get_host_info(); } if (! empty($cfg['Server']['verbose']) && $GLOBALS['cfg']['ShowServerInfo']) { $server_info .= ')'; } $mysql_cur_user_and_host = PMA_DBI_fetch_value('SELECT USER();'); // should we add the port info here? $short_server_info = (!empty($GLOBALS['cfg']['Server']['verbose']) ? $GLOBALS['cfg']['Server']['verbose'] : $GLOBALS['cfg']['Server']['host']); } echo 
' . "\n"; echo '
'; if ($server > 0 || count($cfg['Servers']) > 1 ) { echo 
; echo '
' . __('General Settings') . '

'; /** * Displays the MySQL servers choice form */ if ($cfg['ServerDefault'] == 0 || (! $cfg['NavigationDisplayServers'] && (count($cfg['Servers']) > 1 || ($server == 0 && count($cfg['Servers']) == 1) ) ) ) { echo '
'; include_once 'libraries/select_server.lib.php'; echo PMA_Util::getImage('s_host.png') . " " . PMA_selectServer(true, true); echo '
'; } /** * Displays the mysql server related links */ if ($server > 0 && ! PMA_DRIZZLE) { include_once 'libraries/check_user_privileges.lib.php'; // Logout for advanced authentication if ($cfg['Server']['auth_type'] != 'config') { if ($cfg['ShowChgPassword']) { $conditional_class = 'ajax'; PMA_printListItem( PMA_Util::getImage('s_passwd.png') . " " . __('Change password'), 'li_change_password', 'user_password.php?' . $common_url_query, null, null, 'change_password_anchor', "no_bullets", $conditional_class ); } } // end if echo '
'; echo '
' . "\n" . PMA_generate_common_hidden_inputs(null, null, 4, 'collation_connection') . ' ' . "\n" . ' '. PMA_Util::getImage('s_asci.png') . " " . __('Server connection collation') . "\n" // put the doc link in the form so that it appears on the same line . PMA_Util::showMySQLDocu( 'MySQL_Database_Administration', 'Charset-connection' ) . ': ' . "\n" . ' ' . "\n" . PMA_generateCharsetDropdownBox( PMA_CSDROPDOWN_COLLATION, 'collation_connection', 'select_collation_connection', $collation_connection, true, 4, true ) . '
' . "\n" . '
' . "\n"; } // end of if ($server > 0 && !PMA_DRIZZLE) echo '


'; // Displays language selection combo if (empty($cfg['Lang']) && count($GLOBALS['available_languages']) > 1) { echo '
'; include_once 'libraries/display_select_lang.lib.php'; echo PMA_Util::getImage('s_lang.png') . " " . PMA_getLanguageSelectorHtml(); echo '
'; } // ThemeManager if available if ($GLOBALS['cfg']['ThemeManager']) { echo '
'; echo PMA_Util::getImage('s_theme.png') . " " . $_SESSION['PMA_Theme_Manager']->getHtmlSelectBox(); echo '
'; } echo '
'; echo PMA_Config::getFontsizeForm(); echo '
'; echo '

'; PMA_printListItem( PMA_Util::getImage('b_tblops.png')." " .__('More settings'), 'li_user_preferences', 'prefs_manage.php?' . $common_url_query, null, null, null, "no_bullets" ); echo '


    ' . "\n"; PMA_printListItem( __('Server') . ': ' . $server_info, 'li_server_info' ); PMA_printListItem( __('Server type') . ': ' . PMA_Util::getServerType(), 'li_server_type' ); PMA_printListItem( __('Server version') . ': ' . PMA_MYSQL_STR_VERSION . ' - ' . PMA_MYSQL_VERSION_COMMENT, 'li_server_version' ); PMA_printListItem( __('Protocol version') . ': ' . PMA_DBI_get_proto_info(), 'li_mysql_proto' ); PMA_printListItem( __('User') . ': ' . htmlspecialchars($mysql_cur_user_and_host), 'li_user_info' ); echo '
    '; echo ' ' . __('Server charset') . ': ' . ' ' . ' ' . $mysql_charsets_descriptions[$mysql_charset_map['utf-8']] . "\n" . ' (' . $mysql_charset_map['utf-8'] . ')' . "\n" . ' ' . "\n" . '
    ' . "\n"; echo ' 

'; echo '
'; } if ($GLOBALS['cfg']['ShowServerInfo'] || $GLOBALS['cfg']['ShowPhpInfo']) { echo '
'; echo '
' . __('Web server') . '
'; echo '

    '; if ($GLOBALS['cfg']['ShowServerInfo']) { PMA_printListItem($_SERVER['SERVER_SOFTWARE'], 'li_web_server_software'); if ($server > 0) { $client_version_str = PMA_DBI_get_client_info(); if (preg_match('#\d+\.\d+\.\d+#', $client_version_str) && in_array($GLOBALS['cfg']['Server']['extension'], array('mysql', 'mysqli')) ) { $client_version_str = 'libmysql - ' . $client_version_str; } PMA_printListItem( __('Database client version') . ': ' . $client_version_str, 'li_mysql_client_version' ); $php_ext_string = __('PHP extension') . ': ' . $GLOBALS['cfg']['Server']['extension'] . ' ' . PMA_Util::showPHPDocu( 'book.' . $GLOBALS['cfg']['Server']['extension'] . '.php' ); PMA_printListItem( $php_ext_string, 'li_used_php_extension' ); } } if ($cfg['ShowPhpInfo']) { PMA_printListItem( __('Show PHP information'), 'li_phpinfo', 'phpinfo.php?' . $common_url_query, null, '_blank' ); } echo ' 

'; echo '
'; } echo '
'; echo '
phpMyAdmin
'; echo '

    '; $class = null; // We rely on CSP to allow access to http://www.phpmyadmin.net, but IE lacks // support here and does not allow request to http once using https. if ($GLOBALS['cfg']['VersionCheck'] && (! $GLOBALS['PMA_Config']->get('is_https') || PMA_USR_BROWSER_AGENT != 'IE') ) { $class = 'jsversioncheck'; } PMA_printListItem( __('Version information') . ': ' . PMA_VERSION, 'li_pma_version', null, null, null, null, $class ); PMA_printListItem( __('Documentation'), 'li_pma_docs', PMA_Util::getDocuLink('index'), null, '_blank' ); PMA_printListItem( __('Wiki'), 'li_pma_wiki', PMA_linkURL('http://wiki.phpmyadmin.net/'), null, '_blank' ); // does not work if no target specified, don't know why PMA_printListItem( __('Official Homepage'), 'li_pma_homepage', PMA_linkURL('http://www.phpMyAdmin.net/'), null, '_blank' ); PMA_printListItem( __('Contribute'), 'li_pma_contribute', PMA_linkURL('http://www.phpmyadmin.net/home_page/improve.php'), null, '_blank' ); PMA_printListItem( __('Get support'), 'li_pma_support', PMA_linkURL('http://www.phpmyadmin.net/home_page/support.php'), null, '_blank' ); PMA_printListItem( __('List of changes'), 'li_pma_changes', PMA_linkURL('changelog.php'), null, '_blank' ); ?> 

1) { trigger_error( __('You have enabled mbstring.func_overload in your PHP configuration. This option is incompatible with phpMyAdmin and might cause some data to be corrupted!'), E_USER_WARNING ); } /** * Nijel: mbstring is used for handling multibyte inside parser, so it is good * to tell user something might be broken without it, see bug #1063149. */ if (! @extension_loaded('mbstring')) { trigger_error( __('The mbstring PHP extension was not found and you seem to be using a multibyte charset. Without the mbstring extension phpMyAdmin is unable to split strings correctly and it may result in unexpected results.'), E_USER_WARNING ); } /** * Check whether session.gc_maxlifetime limits session validity. */ $gc_time = (int)@ini_get('session.gc_maxlifetime'); if ($gc_time < $GLOBALS['cfg']['LoginCookieValidity'] ) { trigger_error( __('Your PHP parameter [a@http://php.net/manual/en/session.configuration.php#ini.session.gc-maxlifetime@_blank]session.gc_maxlifetime[/a] is lower than cookie validity configured in phpMyAdmin, because of this, your login will expire sooner than configured in phpMyAdmin.'), E_USER_WARNING ); } /** * Check whether LoginCookieValidity is limited by LoginCookieStore. */ if ($GLOBALS['cfg']['LoginCookieStore'] != 0 && $GLOBALS['cfg']['LoginCookieStore'] < $GLOBALS['cfg']['LoginCookieValidity'] ) { trigger_error( __('Login cookie store is lower than cookie validity configured in phpMyAdmin, because of this, your login will expire sooner than configured in phpMyAdmin.'), E_USER_WARNING ); } /** * Check if user does not have defined blowfish secret and it is being used. */ if (! empty($_SESSION['auto_blowfish_secret']) && empty($GLOBALS['cfg']['blowfish_secret']) ) { trigger_error( __('The configuration file now needs a secret passphrase (blowfish_secret).'), E_USER_WARNING ); } /** * Check for existence of config directory which should not exist in * production environment. */ if (file_exists('config')) { trigger_error( __('Directory [code]config[/code], which is used by the setup script, still exists in your phpMyAdmin directory. You should remove it once phpMyAdmin has been configured.'), E_USER_WARNING ); } if ($server > 0) { $cfgRelation = PMA_getRelationsParam(); if (! $cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == false ) { $msg = PMA_Message::notice(__('The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. To find out why click %shere%s.')); $msg->addParam( '', false ); $msg->addParam('', false); /* Show error if user has configured something, notice elsewhere */ if (!empty($cfg['Servers'][$server]['pmadb'])) { $msg->isError(true); } $msg->display(); } // end if } /** * Warning about different MySQL library and server version * (a difference on the third digit does not count). * If someday there is a constant that we can check about mysqlnd, * we can use it instead of strpos(). * If no default server is set, PMA_DBI_get_client_info() is not defined yet. * Drizzle can speak MySQL protocol, so don't warn about version mismatch for * Drizzle servers. */ if (function_exists('PMA_DBI_get_client_info') && !PMA_DRIZZLE) { $_client_info = PMA_DBI_get_client_info(); if ($server > 0 && strpos($_client_info, 'mysqlnd') === false && substr(PMA_MYSQL_CLIENT_API, 0, 3) != substr(PMA_MYSQL_INT_VERSION, 0, 3) ) { trigger_error( PMA_sanitize( sprintf( __('Your PHP MySQL library version %s differs from your MySQL server version %s. This may cause unpredictable behavior.'), $_client_info, substr( PMA_MYSQL_STR_VERSION, 0, strpos(PMA_MYSQL_STR_VERSION . '-', '-') ) ) ), E_USER_NOTICE ); } unset($_client_info); } /** * Warning about Suhosin */ if ($cfg['SuhosinDisableWarning'] == false && @ini_get('suhosin.request.max_value_length') // warn about Suhosin only if its simulation mode is not enabled && @ini_get('suhosin.simulation') == '0' ) { trigger_error( sprintf( __('Server running with Suhosin. Please refer to %sdocumentation%s for possible issues.'), '[doc@faq1-38]', '[/doc]' ), E_USER_WARNING ); } /** * Warning about mcrypt. */ if (! function_exists('mcrypt_encrypt') && ! $GLOBALS['cfg']['McryptDisableWarning'] ) { PMA_warnMissingExtension('mcrypt'); } /** * Warning about incomplete translations. * * The data file is created while creating release by ./scripts/remove-incomplete-mo */ if (file_exists('libraries/language_stats.inc.php')) { include 'libraries/language_stats.inc.php'; /* * This message is intentionally not translated, because we're * handling incomplete translations here and focus on english * speaking users. */ if (isset($GLOBALS['language_stats'][$lang]) && $GLOBALS['language_stats'][$lang] < $cfg['TranslationWarningThreshold'] ) { trigger_error( 'You are using an incomplete translation, please help to make it better by [a@http://www.phpmyadmin.net/home_page/improve.php#translate@_blank]contributing[/a].', E_USER_NOTICE ); } } /** * prints list item for main page * * @param string $name displayed text * @param string $id id, used for css styles * @param string $url make item as link with $url as target * @param string $mysql_help_page display a link to MySQL's manual * @param string $target special target for $url * @param string $a_id id for the anchor, * used for jQuery to hook in functions * @param string $class class for the li element * @param string $a_class class for the anchor element * * @return void */ function PMA_printListItem($name, $id = null, $url = null, $mysql_help_page = null, $target = null, $a_id = null, $class = null, $a_class = null ) { echo '
'; if (null !== $url) { echo ''; } echo $name; if (null !== $url) { echo '' . "\n"; } if (null !== $mysql_help_page) { echo PMA_Util::showMySQLDocu('', $mysql_help_page); } echo '
'; } ?> 

There's a lot more of this text. I couldn't find the file containing this data. Anyone have any idea why this is loading when I try to open http://localhost/phpmyadmin?

Grant
  • 2,413
  • 2
  • 30
  • 41
total_noob
  • 55
  • 1
  • 1
  • 6
  • 1
    Seems like the server isn't reading your php files. Are u sure that the server is set up correctly? – Philip G Mar 18 '14 at 11:45
  • I believe PHP is currently running. When I visit localhost, this is printed out: "Apache/2.4.6 (Ubuntu) Server at localhost Port 80", so I think the server is setup correctly. – total_noob Mar 18 '14 at 11:50
  • 1
    @Dave Just create a php file with ,And run it to check php is running – Shijin TR Mar 18 '14 at 11:54
  • 1
    Try `sudo apt-get install php5` in a shell to be sur that php5 is installed. – Debflav Mar 18 '14 at 11:56
  • php5 is installed. php might not be running though. localhost shows:`Index of /`, but no files are present. the php script doesn't run either. – total_noob Mar 18 '14 at 12:07
  • Check in apache logs if you have errors. – Debflav Mar 18 '14 at 12:31
  • Possible duplicate of [PHP code is not being executed, instead code shows on the page](http://stackoverflow.com/questions/5121495/php-code-is-not-being-executed-instead-code-shows-on-the-page) – miken32 Sep 04 '16 at 22:05

6 Answers6

3

When installing apache2 on linux php5 isn't installed with it.

Try running these commands:

sudo apt-get install php5 libapache2-mod-php5
sudo /etc/init.d/apache2 restart

When apache has restarted create a index.php file to check if everything works.

index.php

<?php
 echo "HELLO WORLD PHP WORKS !";

Save it, visit localhost and check if the hello world is displayed.

Jens
  • 1,132
  • 7
  • 14
3

your PHP is OK. I think that is a navegator problem. You have this problem with firefox? you can try to acces with chrome. If you have Firefox Web developer you can disable proxy: "Disable" - "Disable proxy" - "Use no proxy"

jmocana
  • 31
  • 2
  • I'm glad I saw this. I'm trying to make phpmyadmin work from `localhost/phpmyadmin` as well as the other two: `127.0.0.1/phpmyadmin` and `[::1]/phpmyadmin`. From Firefox I get spurious successes that have been driving me crazy. After reading this answer, I tried Safari using all three addresses and they all worked. In my case, I needed to go into Firefox's Preferences and clean the cached web content (Advanced -> Network), or I could have done this by deleting specific history entries. Now both browsers work. – gone Jul 18 '20 at 14:54
1

was same problem with phpmyadmin

addJSON( 'options' .....

just install this module, must work

sudo apt install libapache2-mod-php7.0
sudo service apache2 restart
Alexey
  • 11
  • 2
0

The CentOS packages repo appears to only have PHP 5.3 available at the moment, but these commands seemed to work for me.

rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
yum remove php-common       # Need to remove this, otherwise it conflicts
yum install php54w
php --version               # Verify version has been upgraded

You can also use php55w or php56w as required.

Rishi Kulshreshtha
  • 1,748
  • 1
  • 24
  • 35
0

I had a similar problem on Scientific Linux EL7 not Ubuntu, the directives in my VirtualHosts httpd.conf disabled the php engine for the directory / or the entire server except where explicitly added.

[...]
    <Directory />
            Options FollowSymLinks
            php_flag engine off
            Require all denied
    </Directory>
[...]

I ended up adding the following lines to my VirtualHosts httpd.conf to allow PHP files to be processed correctly in the /usr/share/phpMyAdmin directory.

[...]
    <Directory /usr/share/phpMyAdmin/>
            Options FollowSymLinks
            php_flag engine on
            Require all granted
    </Directory>
[...]

Once the webserver was restarted, phpMyAdmin worked!

Changes to the main apache2 configuration file, httpd.conf, should work to make sure that the php engine is enabled for phpMyAdmin's installation directory. No Ubuntu machine for me to look at; but, these settings worked on my Scientific Linux EL7 distro which should also work for CentOS and RHEL7.

kaosengr
  • 326
  • 2
  • 5
0

Try to verify you have PHP5 or PHP7 is installed. If you're not sure then install any version first by:

sudo apt-get install apache2

After the installation, see if you'd get this page by visiting http://your_server_IP_address.

Install PHP by running this command (with MySQL support):

sudo apt-get install php libapache2-mod-php php-mcrypt php-mysql

The main reason you're not being able to execute PHP files in my opinion would be not configuring this part properly. Please try and do it.

In most cases, we'll want to modify the way that Apache serves files when a directory is requested. Currently, if a user requests a directory from the server, Apache will first look for a file called index.html. We want to tell our web server to prefer PHP files, so we'll make Apache look for an index.php file first.

To do this, type this command to open the dir.conf file in a text editor with root privileges:

sudo nano /etc/apache2/mods-enabled/dir.conf

contents would looks like below:

<IfModule mod_dir.c>
    DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
</IfModule>

Bring index.php to the front of the sequence.

<IfModule mod_dir.c>
    DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm
</IfModule>

Save the file and restart the apache2 server by running:

sudo restart apache2

Navigate to http://ip_address/phpMyAdmin and see your new results. Hopefully everything will works by now.

CodeMonkey
  • 2,828
  • 1
  • 23
  • 32