Avatar of ltpitt
ltpitt

asked on 

Suggestions to build quickly and efficiently a PHP rest interface that works in shared hosting with only FTP access

Hi everyone!

I just have a tiny DB with two tables and I would like to build a tiny REST api to that will handle insert / retrieve / update / delete.

Nothing fancy at all, I'd just need speed and simplicity and the chance to quickly upload it to FTP access without long setting of environment.

What is your suggestion to implement this?

Even a simple jot of an idea or a framework suggestion is enough to give me a big help, no need for specific code.

Kind regards
DatabasesPHPREST

Avatar of undefined
Last Comment
ltpitt
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of ltpitt
ltpitt

ASKER

Lumen is fantastic for the job but it will be an hassle to setup the server, just having FTP access.
There are a few tutorials on the topic but they all look hacky and painful.
I will quickly check the other solution and provide feedback soon :)
Avatar of Olaf Doschke
Olaf Doschke
Flag of Germany image

First google result, I think it's quite neat:

https://www.leaseweb.com/labs/2015/10/creating-a-simple-rest-api-in-php/

What complexity level do you have in mind? Eg this states in itself it's not written for anything needing joined data. In your two table case you might or might not need joins at all, you might only need another way of sending in foreign key instead of primary key, so you can get related data.

The first thoughts should be about the url pattern you need to provide your functionality, then the REST follows ;).

Bye, Olaf.
Avatar of Mark Brady
Mark Brady
Flag of United States of America image

If you only have FTP access you will need your hosting company to setup the database and tables according to your needs and give you the host name, username and password to access it.

Usually with even shared hosting you can go to your dashboard and set these things up yourself which is the only was I would ever consider a shared hosted account. FTP is used to upload any code changes you have made (your website)
Avatar of ltpitt
ltpitt

ASKER

@Mark

I have access to phpmyadmin and ftp

I am asking about microframeworks to easily and quickly develop a simple api service (keeping in mind the above constrictions)

Thanks for your help!
Avatar of Olaf Doschke
Olaf Doschke
Flag of Germany image

Well, Mark, even without phpmyadmin you can execute PHP scripts uploaded by FTP, that create tables. Cumbersome, but quite a normal setup in olden times, where we even didn't have phpmyadmin or anything like plesk or even ssh access to simply hosting webspace with a given MySQL database.

Bye, Olaf.
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Wow, what did we do wrong?  Why did you give a marked-down grade?
Avatar of ltpitt
ltpitt

ASKER

Even if the answers are somewhat correct are simply the fruit of a google search and no added guidance was provided.
In the request I was looking for:
Nothing fancy at all, I'd just need speed and simplicity and the chance to quickly upload it to FTP access without long setting of environment.

I am not complaining but...
All I got was "might be useful" and "never tried it"

An A grade solution is an A grade solution :)

No offense at all, I follow your answers and I think that you are a true myth in the community.
PHP
PHP

PHP is a widely-used server-side scripting language especially suited for web development, powering tens of millions of sites from Facebook to personal WordPress blogs. PHP is often paired with the MySQL relational database, but includes support for most other mainstream databases. By utilizing different Server APIs, PHP can work on many different web servers as a server-side scripting language.

125K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo