How to upload PHP and MySQL into a webserver - php

I am developing a site in vertigoserver. Now I need to test the webpage in webserver.
I am using the webserver Host-Europe VirtualServer 3.0.
Now what are the steps I need to upload the PHP pages?
What is the software needed to upload MySQL queries?
Are there any tutorials or suggestions?

This seems like basic stuff, but I'll give you some pointers!
Upload the pages with an FTP client or similar. If you have shell access, tools like rsync can make this easier.
You've probably got some sort of web based front end for MySQL like phpMyAdmin - this will let you upload and restore a database dump. If you have shell access, or if the MySQL server is open to the Internet, you can pipe the dump into the MySQL command line client, for example,
mysql -h<hostname> -u<username> -p<password> mydatabase < dump.mysql

Okay, you got a virtual machine and don't know how to upload stuff? This has been discussed in Host-Europe forums for a while. If you don't know the basics you probably don't want to run a server on your own. If you don't know how to use Linux don't start with a machine which can get you in a lot of trouble. A hosting package is probably better you at the moment.
The problem I have is you didn't specify what OS you have. If you're using Linux with Plesk you want to activate FTP, etc. If you are using Linux without Plesk you want to upload the PHP files with WinSCP and over SSH (SCP).
If you are running Windows with Plesk use FTP. If not, you should install an FTP server on the machine.
Regarding the MySQL stuff you're probably best off installing a webfrontend for MySQL.
!DON'T FORGET TO SECURE IT!

Related

Configuring php desktop chrome for allowing it to connect to sql server

I wanted to convert my php application into desktop application to run it as an .exe file by just double clicking on it. For this I found many third party softwares like bamcompile,wapache,Php desktop chrome,etc. From these the most compatible and the one which fulfilled my requirements to accountable extent was php desktop chrome.The rest both had their drawbacks-
1.Bamcompile-It runs the application on commandline and does not show GUI,so I was not comfortable with that.
2.Wapache-It runs the application but it run it in Internet explorer browser so it cannot run the framework supported by my application.I need Google Chrome for that.
3.Php desktop chrome- This fulfills my requirement to a great extent but the problem is that it does not supports sql server database.I thought about using sql server as database because I don't want to install xampp/wamp on every machine where I want to use my application.I added the drivers needed for using sql server to php desktop/ext folder but I am not finding the php.ini in php desktop application where I can add extension to it.So it there any way that I would not have to install xampp/wamp or any other application on client machine to run my application.
Problem with converting the application into exe file is solved with php desktop. That means when I start only mysql from xampp my application runs perfectly fine ,there is no need to start apache for that.So now I want to do something that can include my database as well in the php desktop chrome folder and supporting application into it as well.So that I don't need to start phpmyadmin always.Or is it possible to install only phpmyadmin/MySQL without xampp and if yes how to configure that?Because I installed that individually but I don't know why is it showing Access denied.
Thanks in advance.
I have tried to provide as much details as possible ,in case you need to know anything else,please let me know. I have tried all possible way please help me out.
Your need is quite exotic. Try phpinfo() in your application - then you will find where your php.ini is served from. That might put you on track. Another thing to try, if your database is not too big, SqlLite database in your project, because it is bundled with php and does not require a separate server.

How Can I make portable xampp project

Let I have developed a dictionary application in mysql using php in xampp. That is i can access it using localhost from my browser. But i do not want it to be online. I want to release an offline version of it. So that I can distribute the project using cd or pendrive and user just take it and run it. That is I want to make it portable in offline.
How can I do that. That is should I install xampp in all the cd and import my database ? Or is there any smart solution?
By it's very nature, XAMPP is portable. You can just extract it and run it. When you run it it will run Apache, mySQL and you can access it by http://localhost or by a different address according to your host file configuration if it has been changed from the default.
So put it on a laptop or onto a pen drive and you can run your code and database from it.
Here's the description of XAMPP:
XAMPP is an integrated server package of Apache, mySQL, PHP and Perl (the AMPP in XAMPP) that all run from a removable drive. Everything is pre-configured and ready to go just by unzipping or installing it.
Why not to search first? )
There is similar question: https://stackoverflow.com/a/12272455/2792335
I think you should first migrate database from MySQL to something like SQLite to avoid need of db server installation.
Then use something like http://www.nusphere.com/products/phpdock.htm or one of applications referenced in the above mentioned answer.
PHP and mysql is not a good platform for such task. PHP to operate need running sever(i.e apache) with support for right version of php. an mySQL is commercial product, you can use it for free, but if you want to include it with your product as you described you need commercial license. I would suggest to rewrite product to another platform. In example you can use JavaScript and HTML5 storage instead for data. or pick different database.

Getting familiar with XAMPP

Iam not able to get familiar with XAMPP interface on Windows7 (Only prior experiencxe is with HTML,C,C++).
How to proceed to begin development work in PHP and MySQL and test developed contents using Apache Server.
Please help to understand its working flow.
Thanks in Advance.
First, find a good PHP book or tutorial to learn PHP. There are plenty out there, just Google or visit the PHP homepage.
As you follow the book or tutorial, save your .php files in the XAMPP htdocs folder. This will let you view your results using the XAMPP web server. For example, if you write a PHP script called test.php and save it in the htdocs folder, you can access it on your local XAMPP server via http://localhost/test.php.
XAMPP includes phpMyAdmin, which lets you manage the included MySQL database. You can learn more about phpMyAdmin here.
Be sure to read the XAMPP documentation so that you know how to start up Apache and MySQL and access phpMyAdmin.
XAMPP is only a service that provides a webserver, server side language (PHP), database and interface to connect to said interface. Once it is installed you are good to go, all you need to do is turn on Apache, then MySQL. All the rest of the installation requirements should be done automatically upon installation.
Maybe it is better to explain your particular issue...
I was beginning from Denwer. It was very easy to begin with him. He includes php, mysql, apache.
http://www.denwer.ru
You have to run the Apache server for php and the MySQL server for MySQL :D. You can run it by starting the XAMPP Control and than run them. Now you can go to the localhost http://localhost/
There are some instructions.
I hope it is useful.
Marcel
Do you really need XAMPP? Sumit, I also have Win7/x64 on one machine, where I installed
Apache 2.2.16 for 32bit Windows
PHP 5.3.2 (x32 Windows VC6 install binary)
Perl 5.12.1 32bit x86 from Activestate
MySQL 5.1 32bit x86 Windows installer)
I installed all-32-bit stuff (even if on 64bit Windows) because that guarantees you a much simpler life. You can handle or maintain every component individually, for including PHP or Perl into Apache, you just change a line or two in the Apache config file. There's no magic at all with all these programs. Install them by yourself and learn a lot in the process.

How to get started with sql and php?

I was wondering how to link a SQL database on my PHP code.
I am using a database on my local server that I set up and I have already created a database, I tried writing a PHP script with ++notepad, but when I clicked on the script, it opened the browser and displayed a blank page. What am I doing wrong? I created my databases using phpMyAdmin.
You need to be running a web server locally which supports PHP (like Apache). It it the web server which does the PHP processing. At the same time you will have to run a MySQL (or any other) database engine too, so your PHP code can connect and query it. (I'm assuming you've already installed PHP.)
I would recommend you install XAMPP which includes Apache, PHP, MySQL and a bunch of other stuff. It one of "Apache friends". Once you install XAMPP you would have a folder htdocs in the xampp folder. Create a folder for you project myproject and place your PHP script script.php in there. Now if MySQL and Apache are running following should behave as you expect.
http://127.0.0.1/myproject/script.php
For the tutorial, to begin with you can use W3Schools. Brief and to the point. They have both a PHP tutorial and a SQL tutorial.
This is a very good book to start with:
PHP and MySQL
Web Development
Luke Welling and Laura Thomson
You have to play with php/sql code practically. Only reading cant help!
go for w3shools as mentioned above :)
start with simple code and then go to the complexity. all the best.. :)
There are multiple ways on how to do that.
One of the most modern ways to do that, is to use PDO to connect to the DB with PHP.
To run PHP on your PC(which i assume is your workstation), you need the supporting software for it, for php to run you need the PHP software installed, and likewise if you want to run the server software you need apache, however you can go for a single install package which will install almost everything for you to run your php script, download and install the wamp.
to install wamp which stands for (windows, apache, mysql, PHP) if you are running windows, and lamp for linux or mamp for mac, all of which are free softwares, you can download wamp from the following link. http://www.wampserver.com/en/download.php that is the first step which you need to do.
step 2: once wamp is installed the default directory of installation is C:/wamp (i reccomend do not change the location of the installation), you need to start the wamp server by just opening or double clicking the software which you just installed.
step3: navigate to the default directory where you should be storing your PHP files and that is C:/wamp/www note that you should be keeping all your PHP files here apart from this location if you store it anywhere else it wont simply run at all, and that it should and must have the .php extension.
step4: create or save the php files in this location(c:/wamp/www) i for example will assume you have created a file test.php in the www folder. now to access this file open your web browser and type http://localhost/test.php there you go, you will have the access to your PHP file (Note: PHP files cannot be run by simply double clicking the file, you have to follow this procedure in order to run the PHP files)
step5: open the test.php in any of your text editor like notepad, or i recommend use an IDE (Netbeans is free and worth a try), and write your code in the following format.
<?php
your PHP code should go here.
?>
when i started writing the code i started by following a nice tutorial which i found in zend.com, it has one of the best examples, and moreover the tutorial is meant for the beginners. hope this helps you..
http://devzone.zend.com/tag/PHP101

start php, apache?

I've just started reading about php, it needs me to install php, apache and MySql to run any php script. can any one suggest me a simplest method to install php, apache and MySql so that i can sun those php script.
I've tried the zip files from php.net, Are those required to run the script offline for practicing the script? what do i do with them? i felt the things given on the same site a bit complex, and was unable to run the script. please help.
I'm assuming you're using Windows - get wamp - it has exactly what you need:
Apache
MySQL
PHP
Wamp comes with a nifty tray controller app which you can use to access the most common tasks, like restarting services, editing config, etc.
Equivalent to Artem's post, just a different organization which packages it differently. And my preference. It is called XAMPP.
If you are using Windows, you could install XAMPP to have the environment setup for you. You'll then need to learn how to bring up the server (basically executing the XAMPP control panel program), copy your PHP scripts into the correct directories (for XAMPP, it'd be C:/[xampp installation dir]/htdocs), access MySQL and creating the necessary MySQL databases (you could access the MySQL via the included PhpMyAdmin).
You can probably refer to a tutorial here (it's a YouTube video, BTW).
Don't have enough rep to comment but wanted to add something to Artem's recommendation of Wampserver. It's what I use on my windows machine, and one of the nicest things about it I find is the ability to have multiple versions of versions of apache, php and mysql installed alongside each other as plug-ins and then select which to have running at any time. It makes it easy for me to emulate the eventual hosting environment for any given project.

Categories