I have a linux machine server, I am able to use php in it. I can only connect to it using a putty command prompt or an FTP program. (basically have limited access).
Is there a way I can use a free database (like mysql)? I'm don't think I can install it on the root folders because of permissions, that's why I was thinking maybe there is a database tool that works as a standalone file, and each database is created as a resource file. That way there is no need for an installation, and you can keep the whole thing in some sub folder in the location where I do have access.
Is this possible?
I am hoping for something like, I download a file, place it on some folder after transferring it through FTP program. Then use php code to create a database and insert/delete records.
And every database created is stored as a file somewhere beside the database tool.
Use sqlite I think is just what you are looking for.
http://www.sqlite.org/about.html
Related
I have two databases for my website. One I run my live website and the other I run a development website. My need is to copy the live database to dev database everyday.
Is there some xml API to achieve this, which will copy my database to another whichever name I want and then rename it further according to my needs.
I have to achieve this entirely using php (No Phpmyadmin interface).
I tried BigDump.php but since my database size is more than 100MB the script breaks.
For this task, I will suggest you please setup cron through cPanel and use mysqldump command for the backup and restart that with mysql command.
You can create simple bash script for this task and setup that script in cron with everyday setting
I have develop one web site in php.
I know how to upload it using ftp(filezilla).
But i dont know how to upload database and i can't do any thing without uploading this database.
please help me to upload my database.
Thank you.
tl;dr version
Ask your hosting provider what methods they support.
More detail
It all depends on your hosting. Do you have a simple hosting account with only FTP access (i.e. no command line or remote desktop access)? In these cases your host usually has phpMyAdmin installed or an alternative web based database management system.
It's unlikely, but you could also try connecting to your MySQL database from your computer. You can download the command line tools or simply get MySQL Workbench, and put in your hostname and test the connection.
If you do have shell access, you can dump your local database with mysqldump and upload the resulting SQL file, then import that on the server. A similar technique can be used with remote desktop.
Normally you could make a gzipped .tar.gz of your DB dump and upload it with a file client to your space... once done unzip it and restore from dump using a mysql commandline or some GUI provided by the site admin.. i'm assuming your DB is MySql as its the obvious choice and you have the privilege to access the DB.... this question seems more suited for serverfault as it seems to have less relation to programming in general. Anyhow
To Tar:
tar –cvzf tarfilename foldername
Untar:
tar –xvzf tarfilename
Example:
tar –cvzf abc.tar.gz abc
This will zip [tar] the abc folder with the name abc.tar.gz
tar –xvzf filename.tar.gz
This will unzip [untar] the file as abc folder.
To backup and restore from dump please refer this link as it has some brilliant illustration.
If you're using MySQL, just export the database from your localhost (phpmyadmin)(click on the database and then search for the export tab ).
When you export it, you need to import it to your online host (your domain).
And to do this, you have to have access to the cpanel of your host.
After logging in to your cpanel , search for phpmyadmin (or whatever database you're using).
Create a database and import your database.
i have developed in-house software for hotel management system using PHP/MYSQL. Our Client wants Software in .exe format and used in desktop. i use various softwares for .exe conversion but it only support php but i want's to connect with MySQL Database. Please anyone can help to create .exe conversion with MySQL Database..
Download PHP Desktop Chrome.
Copy all your code from site directory to Phpdesktopchrome/www directory.
Run Phpdesktopchrome.exe, it will execute like a browser with PHP compiler.
Download Innosetup Software for make exe file.
Install and run Innosetup and select Phpdesktop chrome files to create a EXE file in Option.
Install wampserver in client system with database import.
Enjoy.
There are many compliers available on web by which you can create EXE in PHP.
This program runs through dos and windows only... :) so this is good news for windows user
First Download zip from Here.
Now unzip it and open Command prompt and then go to its directory location.
Start -> run then type ‘cmd’
Use the “cd..” command to change directory.
Place PHP script to be compiled next to bamcompile.exe place it in same directory.
In the cmd prompt, at that directory, type:
bamcompile test.php
variations:
bamcompile -c test.php gives compression.
-e:something.dll allows a DLL to be embedded
Ready made examples are given in Zipped files which you have downloaded,just try it out.
Another application wapache is also there but i dont know much about it.
DOWNLOAD WAMP server from wampserver.com.
its very good for offline use server for desktop, then just copy and paste you script abd .sql file into it. and you are Done.
If your client using highspeed interenet then they can connect the server to online. but they need super computer for more traffic, another option is LAN.
If the program is for office use and no need to connect a lot of computer and internet then use LAN and WAMP.
------ Another possible you can use --------
Install WAMP then copy then .exe file "click start button > all program > and paste into startup folder". server will run automatic windows OS start or restart but it take 2-3 min. (green light)
go to wamp folder > www > make a folder for your program then paste your script.
open any browser then in address bar type "localhost or 127.0.0.1 (localhost IP for offline)" , scroll down and you will see "Your Projects" and under of this you will see your folder which you had create into wamp server > www folder. click on it and here you gooooo....
Now your client can do work with your script. Bookmark it and also create a shortcut into desktop for direct use.
Hope this may help you. thank you.
If you are getting any problem to do this work, then email me here - (krishnabiker#yahoo.com)
I think you should just convince your client not to use a .exe installer. It makes no sense.
You could have an installer that installs a local webserver and a local MySQL, and then opens a web browser and browses the local webserver. This would work, but it means your application runs on only one machine, and can't be used by two people.
On the other hand, you could install an application that talks to a central MySQL database, hosted on the LAN. But then why not install the entire application (webserver, MySQL etc) on the LAN, and have the clients access it across the LAN as a web application? Still no reason for a local install.
I would suggest:
See if you can persuade your client to move to an entirely web-hosted solution. Emphasize how easy updates are - from one central location, not from each machine; or
See if you client won't be happy with a .exe that installs a link to a URL (on the LAN).
VERY SHORT ANSWER: NOT POSSIBLE
Tell your client that it is a client-server application not a desktop app.
One idea is to have portable PHP/MYSQL/APACHE that can be stored in a CD or used and create an autorun fro it..
Tell your client you can do better than that, you can create a batch file for his use!
Then create a program.bat file with one line that runs the php (should be something like "php ").
:)
We need to bundle your project files in MSI ( windows installer ) along with PHP frameworks, MySQL and Apache.
Everything can be included in a single MSI file or you can keep server part in one MSI (PHP framework+Apache framework+ MySQL) and your Project file along with Yiiframework in another MSI.
I already made server part MSI in order to create one of my previous web project. In that project i had to configure Mysql DB (my.ini) and Apache configuration file (.conf). It worked fine.
For a desktop application I recommend that you change your database settings (if you can) and switch to SQLite3 DB. They are portable files and does not need a database server to run.
Use http://www.usbwebserver.com/ and from a stick or an CD/DVD you will be able to run your application. It is a portable version similar to W
When i've worked on Drupal sites before, if there is internal access to the server, or if remote desktop access is available, i've always developed it on the machine it would be ran from when live, and just not made it public on the server.
However, what is the best thing to do if you don't have access to the server yet, for example if the client hasn't got anything in place?
I need to be able to build and test the solution on my local machine, or on my VPS which I have RDP access to, and be able to move it over with as much ease as possible to the clients server when ready.
Any tips or best practices? As far as i'm aware Drupal doesn't have any specific migration tools? I could be wrong though
I don't work with Drupal, but for Prestashop, Wordpress, Zencart, etc. I always use the same workflow:
I setup a vhost in my virtual sever, usually using a subdomain of my own domain (like customer.mydomain.com). Install the software with its DB etc. on the server. Setup FTP access.
I get a local copy of the files, which I maintain in a local git repository, pushing to github for backup purposes mainly.
I work with ZendStudio and configure a remote server and set it up to upload the files when I save them, so I can check them pretty much as if I were working locally. But the main advantage of this approach is that I can share the project with the customer as it progresses.
When I have to move to final server, at least with Wordpress, I have to search/replace the domain name, which wordpress saves on DB. But I do it locally. I download the entire DB as an SQL file through phpmyadmin, open it, searc-replace and upload it again via phpmyadmin to the permanent server.
With ZenCart and others the problem is the config file, which stores some paths. For long projects or long term customers I modify the config file to use some config details or anothers depending on the server name.
adding to the above comment...
Check the "backup and migrate" module and the "backup files" module. "Backup and migrate" is useful in any setup...
with this I was able to do a barebones drupal install and then migrate/replace the database with the one backed up from my local system... if the databases are named differently you will still need to edit the settings.php
"backup files" is useful for themes and content assets like images etc. but is essentially just a wrapper around gzip
I typically develop on my local machine and then upload to server once complete.
All you need to do is change the folder name in /sites/ and change the settings.php file to reflect the server settings/domain.
Something you should be aware of:
If you are uploading files on your local installation, the file paths will be wrong on the server and you will need to execute a one off mysql replace query.
Make sure you use relative paths in any hard coded links.
I am currently working on a web application that uses PHP and MySQL, but I do not have shell access to the server (working on that problem already...). Currently, I have source control with subversion on my local computer and I have a database on the local computer that I make all changes to. Then, once I've tested all the updates on my local computer I deploy the site manually. I use filezilla to upload the updated files and then dump my local database and import it on the deployment server.
Obviously, my current solution is not anywhere near ideal. For one major thing, I need a way to avoid copying my .svn files... Does anyone know what the best solution for this particular setup would be? I've looked into Capistrano a bit and Ant, but both of those look like it would be a problem that I do not have shell access...
I'm using Weex to synchronize a server via FTP. Weex is basically a non-interactive FTP client that automatically uploads and deletes files/directories on the remote server. It can be configured to not upload certain paths (like SVN directories), as well as to keep certain remote paths (like Log directories).
Unfortunately I have no solution at hand to synchronize MySQL databases as well...
Maybe you could log your database changes in "SQL patch scripts" (or use complete dumps), upload those with Weex and call a remote PHP script that executes the SQL patches afterwards.
I use rsync in production but you could do this:
Add a config table into your site to hold what level of DB you are currently at.
During development, store each set of SQL changes into a single file (I use something like delta_X-up.sql). These will stay in your SVN as well. So, for example, if you are at delta_5 and add a table between the current release and the new release, all the SQL needed will be put in delta_6-up.sql
When it comes time to build, export the repo instead of using a checkout. This lets you ignore all the SVN cruft that comes along since you won't need that into production.
Use Weex to push those changes into production (this would be were I would use rsync but you don't have that option). Call a remote script that checks your config DB to see what delta level you are currently at, parse the directory with you delta_x-up.sql files and see if there are any new ones. If there are, read them and run the SQL inside.
You can do a subversion export (rather than checkout) to different directory from your working copy, then it will remove all the .svn stuff for you