how to host existing mysql+php web application on ibm bluemix - php

i'm new to web development. I've coded a sample application using MySQL and php in xampp. now the application is perfectly running on localhost.but i need to host that with free of cost.i tried GitHub pages.but i've got to know that GitHub don't support php+MySQL applications.even i want to try microsoft azure but it's saying you'r school email id is not registered.so i thought to try ibm bluemix. but i don't know how to host php,mysql applications on ibm bluemix.present i don't have anything except code on my computer.please,help me in this issue as soon as possible.i have only single day left to complete the task.
thanks a lot in advance.

Basically you can use this as runtime - https://cloud.ibm.com/catalog/starters/php - mind the pricing plan.
You then need to look for PHP Buildpacks (internet search) which include MySQL, and apply it via the CloudFoundry command line (check IBM Cloud documentation or this
https://docs.cloudfoundry.org/buildpacks/php/index.html).
Hope this helps for the next steps.
There is also a MySQL service, however, it doesn't come for free. However, I think the expected cost is low and I think you currently gain some free money to start with when registering for the first time.
https://console.bluemix.net/catalog/services/compose-for-mysql

Related

REST API advice for beginner

I'm pretty new in this part of programming so any help would be appreciated.
I've made an app and now I want to allow the user to buy via Braintree. I have implemented it with help of some tutorials using PHP SDK, tested on phone using XAMPP and ngrok. It works perfectly (generates token, makes a payment using testing cards) but now I want to move it online. Just simply move that folder from XAMPP instalation folder somewhere online so I (and all other useres) don't need to use ngrok.
Actually, want to replace
final String API_GET_TOKEN = "https:/smthng-random.ngrok.io/braintree/main.php";
final String API_PAY = "http://smthng-random.ngrok.io//braintree/pay.php";
with
final String API_GET_TOKEN = "https:/WHATEVER/main.php";
final String API_GET_PAY = "https:/WHATEVER/pay.php";
so that can give me the same what I've got with xampp and ngrok.
Thanks in advance
btw: PHP is not my better side of programming so it would be great just to move those 2 files (main.php & pay.php) just like they are :) And I've just found that firebase might be option but just exploring for now :)
I think your request is unclear - it's not REST API advice at all, it's about deploying an application to a live environment.
You have successfully installed your web development environment locally (XAMP, nginx) and now it's time to go live.
You basically need a Linux server capable of running, well, apache mysql, php (get where that XAMP comes from?)
This is only an overview, search how to do each of the topics I'll describe:
1. Find a host. (You should go to the shared, vps hostings if you're inexperienced, otherwise, there are way better hosts like linode, digital ocean and AWS, but those can be a little more challenging for beginners.
2. Buy a domain
3. Point the domain's DNS to your host's IP address or NS
4. Now, upload those files you mentioned to the servers public folder. Servers public folders might differ, specially from shared / vps hostings to full-blown Linux instances. If you go the "cloud" way (digital ocean, etc) usually you'll drop the files at /var/www/html
You'll have to set up virtual hosts if you decide to go for the full blown Linux instances
The files should be accessible now. Make sure versions are consistent between your machine and your servers.

PHP Web App - local and online synced versions

I developed a PHP driven Web App with a MySQL backend. New requirement is to have it available offline too at a client's office, once there is an lnternet connection, the two should sync so that both local and online versions are the same. Any advice on how best to implement this?
I found MySQL database Master-Master Replication helpful.
https://www.linode.com/docs/databases/mysql/configure-master-master-mysql-database-replication
no need to write code

Google Cloud SQL - MySQL server has gone away

I have a site remotely hosted away from the Google Cloud SQL instance. I have set up and authorised CIDR range for this. I am using PHP (PDO) to connect to the Google Cloud SQL instance with an application built on the Laravel 5 framework. The website itself is deployed on Windows Azure, I do not have a choice about this stack.
My problem is on probably about 10% of page loads I receive the error:
SQLSTATE[HY000] [2006] MySQL server has gone away
While trying to set up the CIDR for this in the developer console (getting my Azure IP and converting it to a range) I had this problem 100% of the time, so it's possible that it's related to IP authorisation, however why would this work 80-90% of the time, and deny the application sporadically?
Any help would be much appreciated.
go to the cloud sql instance you created. Under properties you will see "authorized applications" click manage and add the project id of your project to it. hope that works for you
I know this is old, but in case someone else ran into similar problems like I did, this might help...
Check your system clock, make sure it's not behind (happened to me with a local docker instance)
Check your credentials to make sure they're correct and match up with the instance you're trying to connect to.
Good luck

Linux accessing SQL Server 2008 R2?

I'm stuck on a real challenge here in my company. I've been programming for the last two months a ticket system based on openSUSE, Apache, PHP, MySQL and CodeIgniter for the framework.
Everything went fine since my company bought the impressive Microsoft Dynamics CRM 2011. I know that Dynamics has a great ticket system inside too, but we're really late with our deadline and I think that learning to customize the Dynamics Ticket System will be difficult.
Now I need to access the Accounts, Contacts and Employees from Dynamics (SQL Server) and use them on my PHP and MySQL system for opening and delegating tickets.
Is there any way to make this possible? I need just a connection for retrieving these three data tables from SQL Server to accomplish my task on this system.
In the MSCRM database, you'll find a view for each of those entities. If you are just trying to read data from CRM, that should work fine. If you need to push data back, you'll need to call the CRM web services. Updating the CRM database directly is not recommended or supported because you'll bypass all the application logic (plugins, workflows, security, etc).
Sure! PHP has support for SQL Server. From Microsoft SQL Server (PHP Manual):
To use the MSSQL extension on Unix/Linux, you first need to build and
install the FreeTDS library. Source code and installation instructions
are available at the FreeTDS home page: ยป http://www.freetds.org/
Make sure you abstract it away nicely!
Another possibility is to write a web service that talks to MSCRM then your PHP/Linux consumes it.
Yeah! I found it!
Basically I turned on the dynamic port on SQL Server and 1433 on TCP port on IPALL
And then on SELinux,
- setsebool -P httpd_can_network_connect = 1
- setsebool -P httpd_can_network_connect_db = 1
Geezus! I lost all my hair on that.

Offline WebApp for iPad

I currently work on an open source e-commerce platform (www.oscmax.com) and I am trying to work out if I can deploy an offline version that can run on an iPad.
I can not seem to find an iPad AMP (Apache MySQL PHP) application and was wondering if anyone could answer:
a) Does anyone know of an AMP version that will run on an iPad
b) Is there another way to achieve this without recoding the entire application in XCode.
The idea is to have a local version of the online store that sales reps can use when selling to wholesale customers that will store the orders locally until they find a WiFi or 3G signal.
If I could get Apache, MySQL and PHP to run locally (like it does using WAMP, MAMP, LAMP, etc.) it would be great.
Any ideas?
You can't run server specific software on an iPad, think of it as a big phone, it just won't do it. The overhead required for mysql / php / apache to run is not something you want on a client side anyway. You need to re-do your app. Simple as that.
The iOS developer terms prohibit the use of interpreted code in native apps which would rule out running PHP through an iOS app. Your best bet would be to look into HTML5 technologies such as offline storage and build a web app.
iOS prohibits apps from spawning processes, and the standard AMP tools spawn lots of processes. So no.
There's an app that appears to serve this need (code and run a php server on an ipad): http://www.becomekodiak.com/kodiak-php.html

Categories