Running: macOS High Sierra Version 10.13.3, zsh w/ iTerm2
Trying to set up a local environment with xampp, which has worked just fine for me in the past. However, I'm now unable to access phpmyadmin after changing the root password via the phpmyadmin UI.
The tutorial I am following (which suggested doing this) pointed me to the config.inc.php file, where the password variable would also need to be updated. Unfortunately, I am unable to edit this file. I've seen other users in Stack Overflow complain of the same issue, but the answer that comes back always seems to involve editing via vi or nano, which doesn't work for me either. Here's an example of what happens when using nano.
I open file via nano
sudo nano config.inc.php
My terminal then prompts me for the system password.
Once in nano, I navigate to the password variable and enter it:
$cfg['Servers'][$i]['password'] = '[mypassword]';
I then attempt to save using ctrl+O, where I'm prompted:
File Name to Write: config.inc.php
and then after hitting ENTER receive the error from nano:
Error writing config.inc.php: Permission denied
I've also tried to editing the file via Sublime Text 3, where my machine prompts me to enter the user password. I receive no error message after doing that, but still cannot access phpmyadmin. I am unable to use chmod to edit permissions on the file, and restarting the mysql server after editing the config.inc.php file also does not work.
Why is nano throwing the "permission denied" error even after I've entered my system password?
Thanks!
I was able to resolve this by accessing the config.inc.php file via the terminal provided by xampp.
First things first, the xampp-provided terminal needed nano (to edit the file) installed.
apt-get update
apt-get install nano
I then navigated to the file:
cd ../opt/lampp/phpmyadmin
Then opened the file with nano:
nano config.inc.php
or try
sudo nano config.inc.php
This finally allowed me to edit the config.inc.php file and successfully save.
Great question. I had to work on this for an hour to figure it out too.
Open Xaamp and go to "Open Terminal" on the main page. Make sure the server is running.
You can run "apt-get update" like the other person said above me. The main one you want is "apt-get install nano"
Then do "cd .." so you can back out of the file. The other person said "cd ../opt/... " but that command didn't work for me. What worked was doing "cd .."
Then do cd again, type in "cd opt/lampp/phpmyadmin"
Then type "nano config.inc.php"
You should now be able to edit it. Hit control + o to save it.
It worked for me. It took me an hour to figure it out.
As I thought, I have the same issue as the above, I tried all the commands and I have changed the config.inc file into these settings :
$cfg['Servers'][$i]['controluser'] = 'root';
$cfg['Servers'][$i]['controlpass'] = '';
But I still end by the same error when I'm acceding to phpmyadmin
Any solutions please ??
Try this to edit the file:
Open terminal from Xampp -> enter apt-get update then -> enterapt-get install nano then -> navigated to the file cd ../opt/lampp/phpmyadmin -> open the file nano config.inc.php make changes as you like -> to save, press control + O and control + M and to exit -> control + X
You might not need to edit the file to solve the error. just try this:
Open terminal from Xampp -> enter apt-get update then -> enterapt-get install nano then -> navigated to mysql folder cd ../opt/lampp/var/mysql -> delete these files rm ib_logfile0 enter and -> rm ib_logfile1 enter
now restart Xampp.
Related
After upgrading phpmyadmin lots of warnings and notices is being shown while running any task. errors is shown below.
Deprecation Notice in .\vendor\twig\twig\src\Loader\FilesystemLoader.php#40
realpath(): Passing null to parameter #1 ($path) of type string is deprecated
Deprecation Notice in .\vendor\twig\twig\src\Markup.php#35
Return type of Twig\Markup::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Deprecation Notice in .\libraries\classes\Util.php#1936
Function strftime() is deprecated
For PHP 7.3+
Edit the following file : config.inc.php. It can be located in /etc/phpmyadmin/config.inc.php or in /usr/share/phpmyadmin/config.inc.php
$cfg['SendErrorReports'] = 'never';
I had the same issue after upgrading my PHP Version to 8.1 using MAMP's phpmyadmin 5. I could only find out a way to get rid of it thanks to this here:
Go to your phpmyadmin, even if it repeatedly logs deprecation warnings into your page
Select the Preferences Tab in your phpmyadmin interface (you have to be in your main phpmyadmin page for this tab to show up, and not have any table / db selected)
Select Functions and scroll down to Error Reports and select Never send and click on OK to save it. done!
I though that this should technically correspond to this:
$cfg['SendErrorReports'] = 'never';
But as it seems, there are additional steps involved. Anyway, working now!
I just used the standard update function from MAMP PRO itself. Menu MAMP PRO > Check for Updates… There i Run Install on the update phpMyAdmin5 5.1.0 -> 5.2.0. That worked for me.
From now you can turn off errors following these two steps:
Open /usr/share/phpmyadmin/themes/pmahomme/layout.inc.php
Add after <?php error_reporting(0);
Please note that this is not official information!
if you use a wamp server then you can put down the downloaded files from [https://www.phpmyadmin.net/downloads/] of PHPMyAdmin new version on apps folder. then go to alias folder and you have to change in
phpmyadmin.conf
Alias /phpmyadmin "d:/wamp64/apps/phpmyadmin5.2.0/" //change it here
<Directory "d:/wamp64/apps/phpmyadmin5.2.0/"> //change it here
then Save and Restart wamp services
I had the same error message on Debian 11 after switching from php7.4 to php8.1.
What solved the issue was upgrading phpMyAdmin to the latest version manually.
=======Steps to followed=====
Back up phpMyAdmin
You should back up your current phpMyAdmin folder by renaming it.
$ sudo mv /usr/share/phpmyadmin/ /usr/share/phpmyadmin.bak
Create a new phpMyAdmin folder
$ sudo mkdir /usr/share/phpmyadmin/
Change to the directory
$ cd /usr/share/phpmyadmin/
Download and Extract phpMyAdmin
$ sudo wget https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz
Now extract
$ sudo tar xzf phpMyAdmin-*-all-languages.tar.gz
Once extracted, list folder
$ ls
You should see a new folder phpMyAdmin-*-all-languages
We want to move the contents of this folder to /usr/share/phpmyadmin
$ sudo mv phpMyAdmin-*-all-languages/* /usr/share/phpmyadmin
Make a copy of /usr/share/phpmyadmin/config.sample.inc.php
$ sudo cp /usr/share/phpmyadmin/config.sample.inc.php /usr/share/phpmyadmin/config.inc.php
Now edit the config.inc.php
$ sudo nano config.inc.php
$cfg['blowfish_secret'] = 'Zbwen/BEAFv:HTbqOROrqakJ;KUMIpV:'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
$ Ctrl+x /* to save the file */
Go to your site/phpmyadmin check all error is cleared.
=================================================
YOU MAY ENCOUNTER THIS ERROR MESSAGE ON PHPMYADMIN /INDEX.PHP
IT MAY SAY SOMETHING LIKE:
The $cfg['TempDir'] (/usr/share/phpmyadmin/tmp) is not accessible.
phpMyAdmin is not able to cache templates and will be slow because of
this.
===SOLUTION==
$ sudo mkdir -p /var/tmp/phpMyAdmin
$ sudo chown www-data:www-data /var/tmp/phpMyAdmin
$ sudo chmod -R 700 /var/tmp/phpMyAdmin
Edit the config.inc.php again
$ sudo nano config.inc.php
add or replace this line
$cfg['TempDir'] = '/var/tmp/phpMyAdmin';
Cleanup --
You can now delete the tar.gz file and the empty folder.
$ sudo rm -rf /usr/share/phpmyadmin/phpMyAdmin-latest-all-languages.tar.gz
And if you’re certain your new phpMyAdmin install is working correctly you can delete the backup folder.
$ sudo rm -rf /usr/share/phpmyadmin.bak
While creating a database, I added a root access password, which initially wasn't set.
And now i cant access localhost/phpmyadmin anymore
mysqli_real_connect(): (HY000/1045): Access denied for user
'root'#'localhost' (using password: NO)
I know I have to edit this line in the config.inc.php file
$cfg['Servers'][$i]['password'] = '';
but I cant save the file after making the edit.
If i do it via opening the file normally, I get this:
Failed to save 'config.inc.php': Insufficient permissions. Select
'Retry as Admin' to retry as administrator.
Even after clicking Retry as admin and entering the sudo password, it gives the same error.
If i try via terminal with sudo access and vim edit, I still get unable to open file for writing error.
I am on a mac. I have tried doing this via sudo from terminal, I have tried changing chmod permissions. I have browsed through almost all of the similar questions here, but none of the solution is working.
Nothing seems to work apparently.
Been stuck at this for an hour. Please help!!!
Only solution I was able to find that worked successfully:
From the starting page of Xampp choose open terminal.
In case nano command is not installed, run the following command:
sudo apt-get install nano
Guide to the enclosing folder of confing.inc.php with the help of cd and ls commands. In my case, the file is in
/opt/lampp/phpmyadmin
Run the following command:
sudo nano config.inc.php
Make the necessary changes and save the file.
You need to shuttdown the mysql service (daemon), then edit your config.inc.php and save it. in this step you can run your mysql service.
I am running Ubuntu 16. I am fairly new to web design but I have set up a LAMP server on my Ubuntu machine and installed WordPress site. I wanted to try to mess around with PHP so I tried to install myphp.
I managed to do this and I realized that I had to install nginx also.
I did this, but my local host always diverts to a message "welcome to Nginx"
I tried to edit the configuration files but could not get it to work?
Is there a guide for installing Nginx and myphp to see phpMyAdmin, after you have already set up a WordPress site?
Like I said I am running Ubuntu 16.04.
You may need to delete the index.html file from the web root. The index.php file should remain.
On Ubuntu+nginx go to html directory using following command
cd /var/www/html/
then find out following index.nginx-debian.html and delete it or edit it as you want
To edit these file open into you editor or use Ubuntu default editor nano.
sudo nano /var/www/html/index.nginx-debian.html
To delete these file run following command.
sudo rm -rf /var/www/html/index.nginx-debian.html
these is the defautl nginx welcome page that why it appear after install, for more information check nginx default configuration file using following command.
sudo nano /etc/nginx/sites-available/default
Thanks
I've installed "PHP PECL EXTENSION/MODULE ON UBUNTU". At the end, I was asked to add some configuration lines in the a file called php_ini that can be found in this path:
/etc/php5/apache2/php.ini
However, after making my changes, I can't save the file because the file is read-only.
What the appropriate action to save my changes. I don't really why the file is read-only, I don't know if there is some thing I need to do. I'm new in Ubuntu/php
Thanks for helping.
For accessing the system files you need root permission.So you would need to use sudo command.it would be like sudo vim /etc/php5/apache2/php.ini(if u are using vim editor) as user2075215 mentioned in comment.
Use command:
"sudo gedit /etc/php5/apache2/php.ini"
It will open text editor, change your settings and save with ctrl+s and close the editor.
All changes will be saved.
Since I am a beginner in Terminal, I used cd multiple times to get to the location of my php.ini file.
cd etc
cd php
cd 7.0
.
.
.
Then I did
$ sudo xdg-open php.ini
and the file popped up and I am able save edits now.
My operating system is Windows 7.
I got my WAMP2.2 install in my computer.
Then I try to install PEAR.
However, I can not find my go-pear.bat file in my wamp directory.
Fine. I download in here: http://pear.php.net/go-pear.phar
and install using this file.
I put the file in
C:/wamp/bin/php/php5.3.8/pear/go-pear.phar
Run the command: php -d phar.require_hash=0 PEAR/go-pear.phar
After the installation, I include the path of pear in php.ini in php and apache folder.
I also include C:/wamp/bin/php/php5.3.8/ in windows $PATH variable.
But when I run pear command. It said it can not find the pear command.
I check the folder and just find a file called pear.bat and pear.ini.
I tried to run pear.bat again in command line. It still does not work.
Experts, please help on this issue.
Ok since many people may be asking the same thing. Let's suppose the following.
I'm currently running 2.2 E which includes Apache 2.2.22 – Mysql 5.5.24 – PHP 5.3.13 XDebug 2.1.2 XDC 1.5 PhpMyadmin 3.4.10.1 SQLBuddy 1.3.3 webGrind 1.0
Now, to install PEAR do the following:
Download this file:
http://pear.php.net/go-pear.phar
And put it on your WAMP server directory under the PHP version on the bin folder.
Run the command to install PEAR and you're over it.
Example (defaults, no change has been done)
Get the file on the link ->http://pear.php.net/go-pear.phar
Go to this directory C:\wamp\bin\php\php5.3.13
Open command prompt (cmd.exe). Supposing you're using Windows Vista and higher, press Start, type "cmd.exe" and right click on it and select run as administrator/CTRL+SHIFT+Enter (Haven't tested on non-priviliges rights)
Use Window's cd command to change the directory to the go-pear.phar file you've just downloaded. In my case I'll be pin pointing it to my own directory, so I did it like follows:
cd "C:\wamp\bin\php\php5.3.13"
Press Enter. You should note that instead of saying "C:\system\32" is now displaying C:\wamp\bin\php\php5.3.13
Write the following command and press Enter:
php -d phar.require_hash=0 go-pear.phar
Select whether you like or not a local copy or a system one. By typing system:local and pressing enter you'll install a local copy. By typing system and pressing enter you'll install a system-wide copy.
Type yes to confirm the option chosen.
The next list of directories, will be the referring directories that PEAR will install its components. If you select from 1 - 12 you can change the directory you'd like to install. By typing all and pressing Enter you'll be able to change them all in a queued manner. In my case, I just pressed Enter and left all defaults
DO THE FOLLOWING IN CASE YOU CONTINUE TO HAVE SOME LISTINGS
11. It is very probable that afterwards you'll receive a message like:
WARNING! The include+path defined in the currently used php.ini does not contain the PEAR PHP directory you just specified: If the specified directory is also not in the include_path used by your scripts, you will have problems getting any PEAR packages working.
Below it will also appear:
Would you like to alter php.ini ? [Y/n]:
Type y and press enter
This should put you running with PEAR on WAMP server :)
pear.bat is the executable on windows. You have to put that directory in your system's PATH variable for the command to be recognized.
All the steps mentioned to below link for GUI based - easy understanding review and setup:
Click here
For anyone looking for a more current answer. On Windows 10 I had to edit .bash_profile to add the following:
function __pear {
pear.bat $#
}
alias pear=__pear