silex do i need composer to autoload? - composer-php

I install my web site on ovh server but i think composer it not install on it.
So i have a fatal error
Class 'App\Models\Product\ProductModel' not found in /home/xxxxx/App/Controller/Home/HomeController.php on line 26
in my ftp i have
composer.json
App
bootstrap.php
Model
Product
ProductModel.php
Controller
indexController.php
Home
HomeController.php
www
index.php
I auto load App as App
Do you know if the problem is composer?
Do you know if i can use with out composer?
How?
thank you

Use Composer before you upload your code. Composer need not be executed on the server - in fact this is regarded more of a problem than a solution because it requires all package hosting servers to be up, and the command line tools for accessing version control systems be installed (at least as a fallback).
The recommended way to use Composer is to run it locally (or on a deployment machine that is local enough), let it fetch all files, create the autoloader, and then copy all the collected files to the target server.
This approach also resolves the problem with Composer requiring about 1GB of memory (or more, depending on how many packages have to be considered) when being run - if your web server has less memory installed, you won't be able to use Composer.

Related

Laravel + Vue js Deploying on Shared hosting

I have a Laravel project that already deployed on shared hosting server but now I just want to add Vue.js component to that project.
Problem is when I was deploying project I didn't install the npm. Can anyone advise me how to fix this thing. I used Laravel 5.8
How can I add Vue component to this project ?
you can't run npm commands in sharing hosting .
you can run npm run production in local and share mixed file on sharing hosting
Usually shared hosting does not provide enough shell commands. So you would need to run npm run production on your local computer.
As a reminder, it is not recommedable to host Laravel website on a shared host. You may need to do extra work to make your Laravel website work such as changing document root of your laravel project.

Laravel setup on HostGator VPS

I want to deploy my Laravel App in a VPS hosting plan.
I have a WHM, but I've no experience deploying my app and configure the server.
I don't have a domain, so I want to test my app using an IP address (like DigitalOcean)
any help?
Edit:
I've completed these steps into my WHM.
Have SSH access to the VPS
Have a sudo user and set up some kind of firewall (for example ufw)
Install required software (nginx, MySQL, PHP, Composer, npm) and additional PHP modules if necessary.
I've created an account ( CPanel ) and I've completed steps
Create a database
Checkout your application using VCS like Git
Configure your .env file.
Install your composer packages, run npm, or anything you would like to do
The account ( CPanel provides an IP address that looks like http://xxx.xxx.x.xx/~cpanel-account-name/).
I can access the website correctly ( however all images are broken and even laravel-routes are not found 404). I know the issue is because ( ~cpanel-account-name/ ) found at the end of the URL.
But how can I fix It?
Since this is quite a broad topic that consists of multiple questions, perhaps you could elaborate on steps you have already taken or the step you are stuck at / need help with?
In short, you need to do the following:
Have SSH access to the VPS
Have a sudo user and set-up some kind of firewall (for example ufw)
Install required software (nginx, MySQL, PHP, Composer, npm) and additional PHP modules if necessary.
Create a database
Checkout your application using VCS like Git
Configure your .env file.
Install your composer packages, run npm or anything you would like to do
Set-up nginx
If this seems daunting, I would advice to tackle it one by one and trying to research every step along the way. This might be challenging and time-consuming, but will be very rewarding!
Alternatively, a paid solution like Laravel Forge can help you take care of server management.

Deployment of Laravel app with Vue component on shared hosting - vue components are not displaying

I'm testing process of deploying app with vue components on shared server. I have access to ssh. Npm is also installed. I check it with "node -v" command. The problem is that vue compoennts are not displaying. I tried to write "npm run production" but I receive an error 126. What should I do to display vue components? I know the voices that shared hosting is not the best choice but I'm just testing. I know that it's possible to turn on vue components on this hosting. I did it long time ago but I forgot how. My process of deployment had 3 steps:
1. Copy files (wihout public_html) from local disc to shared server w
2. Copy public_html do public_html on shared server
3. Changing paths in index.php inside public_html
App is almost working. The problem is with vue components. Please help.
You don't need NodeJs in production. You just need to build it (CSS & JS) on your machine, then upload it. Run npm run production in your local machine, then the public/css/app.css and public/js/app.js will be available (depends on your configuration). Then, just upload these files, done.

hyperledger composer existing network install

composer version v0.19.10
Fabric version 1.1
21 nodes:
3 CLI
3 CA
3 orders
3 www
3 api
6 peers
channel name: common
My fabric network is up and running and I can commit a transaction. But I am trying to add composer playground into the mix. If I try a default install it fails because it wants to use composerchannel. My question is. Is there an way to install composer to an existing fabric deployment.
The Composer Playground uses Business Connection Cards that it finds on your local file system. By default these are under a folder under your home folder e.g. ~/.composer (Maybe you have created a standard PeerAdmin card for a standard 1 peer Development Fabric? )
If you have already connected to the Fabric with Composer, you will have some cards that you already use to commit a transaction. If you have separate machines you can use composer card export on the original machine and composer card import on the machine running Playground.
If you have not connected to the Fabric yet using Composer you might like to look at the Composer Tutorial for MultiOrg which goes through creating cards to connect Composer to the Fabric - it is not your exact scenario, but should provide enough information for you to move forward.
To answer the channel question, one of the files in the "Card" is a connection.json file and in that file the channel to use is specified. (By default composer uses a channel called composerchannel)

laravel 5.2 run composer update at hosting

I developed my website and publish it on my host.while editing it in host I add package in composer file to use it.
My question
How to run composer update in host and how to get CMD screen ?
Or
How to add package in host?
please any one help me
This highly depends on your host. The usual "cheap" hosters are shared hosters. Which might or might not give you access to the cmd. Most probably you do not have root access - that makes a lot of things really hard.
One thing you can always do is running the commands directly from your code. You could put this code behind a specific route for example and remove it after the update.
exec('composer install my-package');
// or
shell_exec('composer install my-package');
You should look for ssh / shell access in your hosters faq. However I highly recommend hosting laravel applications on your own server or at least virtual server so that you have full access to everything.

Resources