How to install mPDF with Composer in Plesk Obsidian - composer-php

I would like to know how to install mPDF on a particular site hosted on a server with Plesk Obsidian running on CentOS 6.10 (Final).
I tried to open Php Composer but the only option I have is Find your Composer applications and there is no option to install new packages.
On the web I read that I should create a file named composer.json and put it in the project directory but I have no idea where to create the directory, how to call the directory and what to put inside this file!
Thanks for your help!

Related

Install pear under XAMPP on mac

I'm setting up my project using XAMPP. I downloaded a few packages using PEAR.
And I noticed the package installation path is not in the XAMPP folder, it was /opt/homebrew/share/pear#7.4.
My local machine and Apache web server are using different PHP version. So I want to set up PEAR seperately. How to install PEAR inside of XAMPP folder and which directory is the best to install? And is there anything I need to setup in php.ini or PEAR config file?
I've tried to install using this command and have seperate config file.
curl -O https://pear.php.net/go-pear.phar
php -d detect_unicode=0 go-pear.phar
The second command lets me change the directories and config file, I was trying to change to /Application/XAMPP/xamppfiles/pear. But the error message says cannot save binary files under the path.

How to install composer globally for laravel app in windows?

I have a question related to composer and laravel. My question is whenever I install the fresh laravel app using command :
composer create-project laravel/laravel blog
Inside my C://xampp/htdocs/ directory and then change path to C://xampp/htdocs/blog/, here I am unable to run the composer command but I had already installed composer from its official website globally in C://xampp/htdocs/ directory. So is there any way to use composer command globally whenever I install fresh laravel app, so that I don't want to install composer in the laravel app directory everytime.
Now I guess they provide direct setting up global installation,
Check here
I did it like this a lot earlier,
Change to the path (or you can add that directory to your path later), and run the installer as mentioned on composer download site to download composer.phar.
Create a new composer.bat file alongside composer.phar.
Using cmd.exe:
run
echo #php "%~dp0composer.phar" %*>composer.bat
Then set it to path environment variable(see this)
Test with a new terminal:
composer -V
Will return
Composer version 1.10.6 2020-05-06 10:28:10
go to composer website and download the exe file, you should have it gloablly if you install it that way.
Good luck ^_^

Laravel install package without composer

I'm just wandering if I can ask this here. I'm trying to install a package called Laravel Page Speed from my site that has already been hosted. My question is how can i install this package / any kind of package without composer into my hosted site. Or if i can install this with composer, how can i do this ?
I use Filezilla for ftp.
I've tried using the cmd's ftp command but its not working. Anyone have manage to do this ? Any answers will be helpful. Thanks
I guess it is shared hosting. Please setup the project on local machine and then install the required package. After installing just replace the hosted site’s vendor directory with your local vendor directory through any ftp client and it should be installed there too.
you need to have ssh access to server and then just run this :
composer require PACKAGE_NAME

How to install Laravel via installer?

In Laravel documentation, it explained one short paragraph on how to use installer to install Laravel.
First, download the Laravel installer PHAR archive. For convenience, rename the file to laravel and move it to /usr/local/bin. Once installed, the simple laravel new command will create a fresh Laravel installation in the directory you specify. For instance, laravel new blog would create a directory named blog containing a fresh Laravel installation with all dependencies installed. This method of installation is much faster than installing via Composer.
I am a Windows 7 user. After download the laravel.phar file, where should I store the file? I don't think there is any /usr/local/bin directory on Windows 7. How can I get the laravel command to be able to use in command window?
Install laravel 5.2 via Laravel Installer in windows 7
Steps:
Please make sure you have installed composer into your computer
Open command prompt
$ composer global require “laravel/installer”
C:\xampp\htdocs> laravel new mylaravel
Youtube video guide:
http://www.pranms.com/how-to-install-laravel-5-2-via-laravel-installer-in-windows-7/
The laravel installer needs to be in your PATH (no matter which Operating system).
In Unix based systems, /usr/local/bin is in your PATH by default.
On Windows, you can add a folder to your PATH by doing like this:
Start the System Control Panel applet (Start - Settings - Control Panel - System).
Select the Advanced tab.
Click the Environment Variables button.
Under System Variables, select Path, then click Edit.
From http://windowsitpro.com/systems-management/how-can-i-add-new-folder-my-system-path
It's a lot easier to install using Composer. Download the Windows Composer installer from the Composer Website and run it. Once it's installed you can run from the command line:
composer create-project laravel/laravel your-project-name
This will create the folder your-project-name and install Laravel in it. The advantage of using Composer it that it makes adding other packages to Laravel really easy.

Laravel 4 Installation Problems on WAMP/Windows

First,I use wamp on my Window7.I open php-openssl,and I git pull the laravel from github.com,and then I put laravel on my d:/wamp/www/, I change the c:/windows/system32.But when I open the url
http://localhost/laravel/public
I see this question.
I am a newbie on laravel,and without install on Ubuntu.Where is my wrong, without no pear,or something else? Thank you!
You need to run composer install in a command prompt.
If you do not have composer, download the phar file from their website.
Place the file you just downloaded into the laravel directory.
Then, make sure that the absolute path to php.exe is added to your PATH environment variable.
Then, you can hold down shift, and right click anywhere inside the laravel directory, and open up a command prompt window. Then, run php composer.phar install. The process may take some time, depending on the speed of your internet connection.
Instead of using the above method, you can download the Composer installer for Windows, install it, and just run composer install.
Note that you only need to do this in order to put the Laravel components together. You do not need to run it on a live server.
Please consult the Laravel Docs for installation and other instructions: http://laravel.com/docs
Try This :
Installing Laravel 4 on WAMP
1. Enable OpenSSL
OpenSSL must be enabled in the PHP configuration.
Edit php.ini in your WAMP’s PHP folder, e.g.:
C:\wamp\bin\php\php5.4.12\
Note: This is not the php.ini in C:\wamp\bin\apache\Apache2.4.4\bin.
Find the following line and remove the semicolon save it:
;extension=php_openssl.dll changed to extension=php_openssl.dll
2. Install Composer
(i).Download the Composer Windows installer from getcomposer.org.
(ii). Run the installer.
(iii). When it asks for the location of php.exe, point it to the executable in your WAMP’s PHP folder, e.g.:
C:\wamp\bin\php\php5.4.12\
(iv). Finish the installation.
(v). Open a command-line interface (cmd) and type:
composer
It should return a list of options. If you get an error, restart your computer and try again.
Composer has now been installed and added to your PATH environment variable. This means you can run it from any directory using the command-line interface.
Now we need to install Composer. This is a dependency manager that will download the latest release of Laravel and specific versions of Laravel’s dependencies, such as Doctrine and Symfony.
3.Install Laravel
Now that Composer has been installed, Composer can download and install Laravel onto your system.
(i). Open a command-line interface (cmd).
(ii). Go to the directory in which you want to install Laravel. This is usually your development directory. In this tutorial, we’ll use C:\wamp\www\laravel
(iii). Instruct Composer to install Laravel into a project directory. we use project name myproject.
composer create-project laravel/laravel myproject --prefer-dist
Note: This will install Laravel in a subdirectory myproject of the current working directory.
Three type of installation to be completed
Now your project was running directory like
C:\wamp\www\laravel\myproject\public\
After completed put tick mark and increase the point....
Do php composer.phar dump-autoload or php artisan dump-autoload

Resources