PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Wed Oct 23, 2019 11:44 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 31 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: Mon Sep 25, 2017 2:36 pm 
Offline
Forum Contributor

Joined: Wed Sep 25, 2013 4:09 am
Posts: 172
Hi,

so the time have come when I'm ready to try out a PHP framework.

I chosed Laravel because I heard it is quite secure and have nice functions for RESTful API. It also seems quite popular and according to what I read in some articles it has a big community and lots of tutorials and is easier to use than some other frameworks if you are new to frameworks.

First question:
I'm gonna make a (hopefully) secure site with login + pw, login with facebook and a restAPI. I'm by no means an php guru but I have some experience. I have ZERO experience with using frameworks.
Do you think Laravel is a good choice for me concidering my "skill" and aim for my project?

Second question:
I used to do all coding straight at my shared host (One.com) in their editor so I never had any local scripts on my computer at home. Last night I installed Apache, netbeans and Laravel (Windows 10).
Do I have to do the laravel site building on my local computer and then upload the result to the shared host or is it possible to install laravel directly on my shared host?

Third question:
If I develope locally..CAN I upload the result to my shared host. Does anyone have experience with Laravel and one.com (<- specifically)?


Ok I think those are enough for now. I will try to do some tutorials now but I'm sure I will return to this thread with more newb questions soon :) Thanks.


Top
 Profile  
 
PostPosted: Mon Sep 25, 2017 3:50 pm 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6425
Location: Montreal, Canada

_________________


Top
 Profile  
 
PostPosted: Mon Sep 25, 2017 5:28 pm 
Offline
Forum Contributor

Joined: Wed Sep 25, 2013 4:09 am
Posts: 172
Ok so I did some routing and middleware / controller tutorials and so far I must say I really really like it so far. It is nothing like I done in my previous projects but I really like the way it is structured (so far, that may change when I'm done with the tutorials and shall try my own code haha).

Great tips, I never used Git before but I seen my friend use it some weeks ago and thought Id try it later on.. might as well do it now then since it seems like I will be developing locally from now on heh.
Digital Ocean looks good but maybe you should check one.com. Its pretty good and cheap. If you write your own code its cheap anyway.. then you pay extra if you want to use their webshop and so on..

Prices:
2,50$/month for basic (unlimited bandwidth, 25GB, 1 domain, 512MB ram, 1DB, PHP & FTP/SFTP, SSL, 1 x CPU)

12$/month for bussiness (unl BW, 500GB, several domains, 2GB ram, several DB, PHP & FTP/SFTP, SSL
8 x CPU, SSH, Backup & Recovery).

And some other subscriptionforms in between ^^


Top
 Profile  
 
PostPosted: Mon Sep 25, 2017 8:28 pm 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6425
Location: Montreal, Canada
I took a look. It’s shared hosting. Not interesting to me. I want full control over the machine I’m hosting on.

Also, yes, learn Git. Git is not optional for software development.

_________________


Top
 Profile  
 
PostPosted: Tue Sep 26, 2017 3:59 pm 
Offline
Forum Contributor

Joined: Wed Sep 25, 2013 4:09 am
Posts: 172


Top
 Profile  
 
PostPosted: Tue Sep 26, 2017 9:36 pm 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6425
Location: Montreal, Canada

_________________


Top
 Profile  
 
PostPosted: Wed Sep 27, 2017 4:34 pm 
Offline
Forum Contributor

Joined: Wed Sep 25, 2013 4:09 am
Posts: 172
I wonder how many could-have-been-coders gave up after trying to set up a programming environment and just took another job heh.

I just can't get it to work :(

I tried to follow some tutorials but it seems many of them forget to mention they already have some stuff set up since before or something or some file been changed and the info is outdated..

Anyway the closest I got was when following this guide:
https://www.youtube.com/watch?v=r5cytqxsZf8&t=248
I got the same result as him up to time:10.01 in the video. Prior to that I only had to make some small modification when he cloned from git.. I think he wrote ... .homestead.git but i it couldnt find the file so i just typed it without the .git at the end.. the structure i got in my folder looked just as his though..

I did create the key as he did (sucessfully) but when i did:
lavarel new test (he named his project deepdive and i named mine test instead) i got an exception
Syntax: [ Download ] [ Hide ]
Crafting application...

                                                         
  [Composer\Exception\NoSslException]                    
  The openssl extension is required for SSL/TLS protection If you can not enable the openssl ex
  tension, you can disable this error, at your own risk, b-tls' option to true.
                                                         

install [--prefer-source] [--prefer-dist] [--dry-run] [--dustom-installers] [--no-autoloader] [--no-scripts] [--no-p] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--c [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packa

Application ready! Build something amazing.


I can't figure out how to solve this..

Anyway it still says the application is ready so I thought I could try it out even if it would be unsecure..

Then I tried to check test.app in my browser but got some other exceptions (like the guy in the video does not get).. I looked around some and there was a suggestion some files were missing in this installation and I should do
composer install in the (test folder)
so I did and the exception went away and now I only get to a page that says:

Whoops, looks like something went wrong.

It looks like lavarel font so I guess I'm pretty close with the installation but I have no clue how to fix the last part..


Another question, the exception I got when making the page (NoSslException) I guess it has to do with it cant find the key I created, I took a copy of the key (after I tried to create the test project) and placed it in another folder closer to c: like c:\key\
Now I have no clue at all what homestead.yaml is but before creating the test project the tutorial said I should change some path in it (under sites: to add /test/...) I see above it says keys ~/.ssh/id_rss and i wonder if it could be this line that makes it dont find my key and maybe i should set an absolute path here like c:\keys\id_rss
but I dont know if thats what causing the error or if I shall mess with the yaml file at all..?

Any ideas?


Top
 Profile  
 
PostPosted: Thu Sep 28, 2017 2:54 am 
Offline
Forum Contributor

Joined: Wed Sep 25, 2013 4:09 am
Posts: 172
Ok so I finally got it to work.

If someone else is going through install-hell and get the same errors:

rename .env.example in your "root" created project file.. for me that created a project named test that would be /test/
rename it to just .env

then instead of oops something went wrong you see debug info.. in my case it was lacking encryption key so I went into shell:
$vagrant@homestead:~/code/test$
and typed artisan key:generate

then i tried in my browser test.app and lo and behold, it finally worked!!! So now I'm back to where I started haha but hopefully the db will work now... bbl


Top
 Profile  
 
PostPosted: Sun Oct 08, 2017 11:37 am 
Offline
Forum Contributor

Joined: Wed Sep 25, 2013 4:09 am
Posts: 172
Hello again,

so I think I finally got homestead to work on my computer and I started a droplet on DigitalOcean running Ubuntu 16.04.3

shall I install homestead on there too or just laravel?

I guess I shall install homestead and if so how do I do that? Can I use Vagrant? Does anyone have a good link to a tutorial?

Thanks :)

EDIT: or do I need to install laravel, mysql, php and so on manually on the digital ocean server?

(at home I run virtualbox, vagrant/homestead)


Top
 Profile  
 
PostPosted: Sun Oct 08, 2017 1:06 pm 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6425
Location: Montreal, Canada
You don’t need Homestead or Vagrant on your droplet. Deploy your code, composer install, and you should be set. You will need to install PHP, a web server, and a database server on your droplet. Digital Ocean has pretty good tutorials for doing all of that.

_________________


Top
 Profile  
 
PostPosted: Sun Oct 08, 2017 5:00 pm 
Offline
Forum Contributor

Joined: Wed Sep 25, 2013 4:09 am
Posts: 172
Woha, some tutorials that actually worked without having to search the net for tons of workarounds :)

Ok so I set up apache, php and mysql (was actually easier to set those things up in DO than to install homestead on my local computer heh).

Ok so another newb question.. shall I install git on the server or only have it on my local computer?

Edit and another question:
I installed laravel on my DigitalOcean site using composer create-project --prefer-dist laravel/laravel test
First i got an error Dont have permission to mkdir() so I manually created the folder test and did a:
sudo chmod 777 test
then installed.
Is 777 the correct setting or should I use something else like 775 or 755?

Also I got some warning:
Failed to dl laravel/laravel from dist: The zip extension and unzip comm are both missing, skipping. the php.ini used by your commandline php is: /etc/php/7.0/cli/php.ini
now trying to dl from source
-installing lavarel/lavarel (v5.5.0)
cloning (number and digits here)

created project in test
loading composer repositories with package information
updating dependencies (including require-dev)
Killed

Did it install ok? if i cd test and ls i see
app, database, public, routes, tests, bootstrap, config, resources, storage folders and some files like CHANGELOG.md, composer.json, package.json, server.php and so on so it seems it installed?

If my site is www.mysite.com where do i find the lavarel welcomepage now? If i try www.mysite.com/test i get The requested URL /test was not found on this server.

Thanks and sorry for the noob questions but im not used to unix, composer, DO, lavarel and all.. its all very new to me :/


Top
 Profile  
 
PostPosted: Mon Oct 09, 2017 7:00 am 
Offline
Forum Contributor

Joined: Wed Sep 25, 2013 4:09 am
Posts: 172
Another question:

Im following this guide to install laravel on DO server:


I created a dir in
usr/local/bin named composer
in
usr/local/bin/composer I have the following files:
composer.phar and composer-setup.php

And I can run composer from all dirs so so far I think I got it right but then in the video at min 4:00 it says I shall make $HOME/.composer/vendor/bin in my $PATH so I did
vim ~/.bashrc
and added the line
export PATH="$HOME/.composer/vendor/bin (Video 4.27)
his .bashrc is empty but mine was not but I guess that doesnt matter so I just added that line to my .bashrc

then I did:
composer global require "laravel/installer"

and it says
changed current directory to /home/myuser/.config/composer
using v 1.4 for laravel installer
./composer.json has been updated
loading composer repositories with package info
updating dependencies
killed

then in the tutorial he can now type laravel and get it to work but when i type laravel it says command not found?

any idea how to fix this?


Top
 Profile  
 
PostPosted: Mon Oct 09, 2017 8:34 am 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6425
Location: Montreal, Canada
On the road today so my ability to respond is limited. Here’s a question, though: what’s the use case for having the Laravel installer on your DO box? You’re not going to be developing on that box, so generating a fresh Laravel install feels to me to be of little value.

_________________


Top
 Profile  
 
PostPosted: Mon Oct 09, 2017 11:42 am 
Offline
Forum Contributor

Joined: Wed Sep 25, 2013 4:09 am
Posts: 172


Top
 Profile  
 
PostPosted: Mon Oct 09, 2017 6:55 pm 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6425
Location: Montreal, Canada

_________________


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 31 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group