Using mysqldump via PHP system($command, $retval) does not work.
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
@OP: you could help explicitly showing the difference between the two programs. If it is about '$retval' being zero or not, use var_dump to print its value.
And, indeed, PHP should not be involved in database-dumping; use ssh to login, and some shell to parametrize program mysqldump.
Found my problem. I had all the files with permission 777 but NOT the directory they were located in. I set the directory to 777 and it now works.
NOW, I've thought about using a bash script (backup.sh) to do this and in the reading I have done, it appears you can't call say, bakup.sh, from html (at least easily). Also I don't really understand why my plan to use PHP to do this is not the thing to do.
I am doing this so I can have a menu with Radio Buttons, 'Backup Database' and 'Restore Database', in my HTML file. This eliminates grubbing around in my files looking for a shell script to backup my data.
In fact this whole security thing is freaking me out. Here are several questions that I hope you will answer.
If my computer is connected to the internet (wifi) and not browsing any particular site is it open to attack?
If I am connected to some particular internet site (wifi) is my computer open to attack?
If my computer is connected to the internet (wifi) but 'hibernating' is it open to attack?
All my use is in regards to my 'Home Database'. However, I am presently encrypting portions of my data in MySql and setting up passwords to access my html database programs.
Any connected computer is open to attack, by using GNU/Linux OS you raise the difficulty to do so, by using a firewall you raise security a little more etc...
The problem using mysqldump remotely with php is connection wise I think, how stable is this connection, how secure and how much time php is allowed to keep the connection (max_execution_time)
I am running Ubuntu 14.04. The programs and data are contained on my computer. I have LAMP set up and use a virtual host with Apache2. I am in the process of encrypting the data in my MySql databases. The actual dump of my data takes milleseconds.
Another security concern is that the javascript is executed on client side so the path to php script will be known, opening access to a ddos atack for example (executing mysqldump many times).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.