Unable to take snapshot with save command in redis - php

I have redis installed on vps server and to os is centos. I am accessing the server using ssh (via Putty from windows).
problem i am facing is when i hit save command my database is not taking the snapshot. My dump.rdb file is empty even after i hit save command on cli. I tired changing the default path of the dump.rdb yet it dint work.
also all the keys in the database get deleted automatically
Will be thankful if anyone can help me in this.
Thanks in advance.

Related

Failed to open the system default web browser. Is one installed? Pgadmin4

Just wondering has anyone come across this issue with pgadmin4?
Every time I go to open it, I get the following:
Failed to open the system default web browser. Is one installed?.
Thanks
In mac make sure the default browser is selected from System preference
Choose System Preferences from the Apple () menu.
Click General
Choose your web browser from the ”Default web browser”
If default browser is set, try to change it and try again. This should solve the problem.
My pgAdmin4 was working fine until today, and then I also received the following:
Failed to open the system default web browser. Is one installed?.
I updated to the most current version and still I received the error.
I did two other things before I fixed the problem so I'm not sure which solved it:
I remembered I got a strange pop up in my browser the day before. I ran a virus scan and a tracking cookie was found, I deleted it.
I changed my default browser from Edge to IE (in Windows 10) and then pgAdmin opened. I then put my default browser back to Edge.
I've killed pgAdmin, then removed .pgadmin folder from the home directory, and now it works like a charm :)
When running pgAdmin, wait for maybe 1-2 mins. It should automatically open in your browser. If you click the button to create a new pgAdmin window before that, it will fail because pgAdmin 4 isn't running yet. The wrong error message will be shown.
If changing the default browser to IE/chromium/chrome does not work, you can try running it as an administrator. That always works for me
I experienced this problem and then 24 hours later everything seemed to be working fine again. I did not delete my internet history, restart my PC or change my default browser. The problem just seemed to fix itself. If you have tried some of the suggestions above and the problem still persists. Then maybe in 24 hours time you will just be lucky and see the problem unexpectedly go away.
This happens because you have some other app listening on port 5432 or some other is already running on this port and pgadmin not being able to override it.
You can check if there are any other apps at this port (in local host at ip http://127.0.0.1) by running following command in powershell:
netstat -ano | findstr :5432
Possible fixes for this problem:
You can configure pgadmin to run at port other than 5432, by right clicking on pgadmin (elephant icon) in your notification shade and click on 'configure' and changing the port to something else, like 22 there.
Or, if you have already setup lots of applications to use postgresql on port 5432 and don't want to change the port, you can kill the application running on 5432 by running:
taskkill /PID 5280 /F
Replace "5280" with the number listed next to LISTENING when you run the first command. this will kill what was running at 5432. Now, you can should be able to run pgadmin without any problems.
Here you can see me finding the app, killing it, checking if it's running after having killed and then checking after running pgadmin:
In first command, I have checked what's running at 5432 port.
In second command, you can see that I have killed it.
In third command, I have checked if there's anything running again.
Then I started pgadmin and checked what's running at port 5432 in fourth and fifth commands. (I clicked on pgadmin and then ran this command quickly, that's the reason you can't see 'LISTENING' in fourth command.)
if you have this problem [Failed to open the system default web browser. Is one installed
]
I fixed that , just by setting another default browser ,in my case I was using Chrome, then I installed Firefox Mozilla but for pgadmin4 to work, you must find the file pgadmin4, that is in file programs :
postgresql/11/pgadmin4/bin/docs/en_US/html/
then you must replaced in the html file "browser" like default with another browser that you prefer (besides Internet Explorer).
The reason why most major browsers don't open up pgAdmin is that it is an applet and major browsers have dropped support for Java. Internet Explorer still supports Java applets at the time of this answer and thus works with IE.
The problem seems to be that pgAdmin4 runs in an old version of Flask, the two simplest options are:
Install it thru pip (not pacman or apt-get) in a virtual env, here is the tutorial from pgAdmin website
Use a different program like Dbeaver
It happens because PGAdmin didn't found a default browser, note PGAdmin is web-based tool and it needs a browser to run.
On windows, go to system settings and set your preferred browser as default browser.

Start PHPmyAdmin from putty - Server is remote

Bit stuck here, I have looked on here, for similar, but cant find what I need.
Have looked at how to start PHPmyAdmin via putty on here.
I have a server, which is on a network. I log into the network via Putty.
The database usual access is for example 10.32.187.100/m . This is how I used to access it before the server reboot.
I have had to restart the server. But I cannot log into the database as I believe I have to turn it on.
As it is not on a local machine I do not know how. It is a linux server, and the location of ‘m’ is /var/www/html
In ‘m’ are the files for phpmyAdmin.
Nothing has been over written. The server had to restart. Hence why I need to start up PHPmyAdmin.
Can I ask how do I turn on PHPmyAdmin via putty I the method I need to use?
try this
sudo service mysql start
sudo service apache2 start

How to solve the error "The localhost page isn’t working" in laravel

I am developing a web application in Laravel 5. I created the project in a local machine at my workplace and it runs just fine. But when i run the machine in another windows machine, it gives me an error The localhost page isn’t working with HTTP ERROR 500 as a server internal error.
I have also tried to look at the laravel.log file and found an exception Call to undefined function site_url() but don't know how to fix this.
Any idea on how to work around this is much appreciated.
This error is coming because you forgot to start laravel service.
If you wish to run your project on http://localhost:8000 Try with the following command :
php arisan serve
If you wish to choose specific port then try with the following command :
php artisan serve --port={port number}
Happy Coding :)
If you run local server by php artisan serve it will give url localhost:8000 by default and will run only in your machine to run in another machine of LAN you need to first find Local IP by ipconfig suppose you get this (192.168.2.10) then use this command.
`php artisan serve --host 192.168.2.10`
this will give url 192.168.2.10:8000 and can be access from any LAN connected machine.
In case none of this was working for you, there may be a more sinister explanation.
In our case, someone who shall go unnamed accidentally deleted the public/index.php file, and committed that to git! So taboo I didn't even think to look. This will stop ANYTHING in your site from running, including logging, but the server will go ahead, so there is nothing to go on, just a 500 error with no response or preview.
Again, seems ridiculous, but it was SO ridiculous who would even look for it?
please change your php version. you need to install php 7.2 version for laravel 5.6 version.

Unable to access MySql db

I have been working on php for some time. I have cloned a git repo yesterday. Just after that i am able to connect to MySQL server, access MySQL db and phpmyadmin properly. Today, I started the server and tried to access phpmyadmin from xampp control panel, as soon as I try to open it, apache port is changing automatically to 49868 and mysql connection terminates.Then, again apache changes its ports to previous states.
Any help is appreciated. Thanks in advance.
EDIT : I reinstalled everything and it worked.
Check if another application is using port 80.
In command prompt use:
netstat -aon | findstr :80
enter image description here
If windows verify if in task manager is already running XAMPP.

Connection to database when changing from online to local server (wordpress)

I'm starting to get crazy with this.
I have to do some modifications to a wordpress website that i didn't create. I have access to the hosting so I downloaded all the files and a copy of the database.
After creating and importing in the local database I went to wp-config.php and change the hosting parametres (user, pass, server,...) for the local ones.
But here comes the troubles. When I change the online server dbXXXX.db.1and1.com to localhost it suddenly stops working and files called index.php won't ever work again
(I get "localhost server not found" error),
even if I change the source folder, or restart MAMP or restart the laptop... The only solution is to unistall MAMP, restart the system and install it again, but when changing the name of the server to localhost it happens again...
Well... If I copy the content of index.php in another file (for example index2.php) and set the parameters to the online server it works again until I change server to localhost.
When I say "it works" means that at least I get "error database connection" from wordpress (due to the online hosting does not allow external requests to its databases).
Can somebody help? Do you need some extra information? Thanks!
MAMP did some crazy this on my PC to, so I decided to switch to WAMP -
http://www.wampserver.com/en/
You may give it a try ?!
Finally I found the error. It's due to the file ".htaccess" that Wordpress (or I don't know who) creates for using permalink and MAC OS X.
When unzipping the web downloaded from the hosting the OS deleted that file because only system files can start with a dot (".htaccess").
I didn't find the solution and just start to work in Windows with BootCamp and all was fine. I was in a hurry to finish this job so I didn't have more time to try new solutions.
So I have not the solution but the source of the problem. Hope this helps someone at least finding the problem and save some time.

Categories