How to install phpwkhtmltopdf without composer? - php

On our production server we are still running PHP 5.3.1.
Composer (https://getcomposer.org/) needs PHP 5.3.2 - so close and still so far...
The only documented way to install phpwkhtmltopdf (https://github.com/mikehaertl/phpwkhtmltopdf) is to use Composer.
So is there any way to install phpwkhtmltopdf without using Composer?
It's just a small wrapper for wkhtmltopdf(http://wkhtmltopdf.org/), so i think it should be possible.
thanks for any help!

Even if your sever doesn't have the required PHP version to run composer you can run/install components locally and then upload them to your server ... with the caveat that the package you are installing doesn't have the same PHP version requirements that composer does.

Related

How to force composer to install even with missing extensions?

I am attempting to install phpspreadsheet via composer on my Mac running macOS 10.15. I know that this version of macOS doesn't have the php zip extension so composer isn't installing the library.
The thing is, the library is going to wind up on a server that does have the zip extension. So, I really don't need for the zip extension to be on my Mac. I just need the library installed so I can upload the vendor folder to the server.
How can I get composer to install it and ignore the extension check? I don't have access to a shell on the server the site runs on so I can't install directly there.
You use the option --ignore-platform-reqs.
Be aware that the zip extension is also directly used for installation. If that fails, Composer will try to install the deps by cloning the repositories, but you would need to at least have git installed on the dev machine.
The docs.

Dependency install errors in composer

I've been a problem when i try to install any dependency using composer.
I tried to use the composer update or composer update. I need to install a chart dependency to my application in Laravel.
When i try to execute any action, show this message below.
This package requires php 7.2.18 but your HHVM version does not satisfy that requirement.
I cannot find a answer to this problem on the internet. I try to install a more recently version of HHVM but i didn't succeed.
Unfortunately HHVM no longer supports vanilla PHP. You should use the vanilla (Zend) PHP runtime, and should not install HHVM as php on your system.
More information on both PHP deprecation and Composer is here: https://hhvm.com/blog/2019/02/11/hhvm-4.0.0.html

Error in installing Symfony4

I am new to Symfony skeleton. Can anyone please help to get out from this error for installation of Symfony? I had searched a lot on the internet but cannot find any working solutions. Composer is working well. I am using PHP7 and XAMP server.
Error is Could not find package Symfony/skeleton with stability Stable in a version installable using your PHP version 7.0.2.
Cerad's answer is correct. Please check Requirements for Running Symfony
It states the following:
Symfony 4.0 requires PHP 7.1.3 or higher to run, in addition to other minor requirements.
If you have to live with php7.0, you are able to install the symfony demo project via symfony installer, see how to install symfony installer for sf3.4.
After you have installed sf installer, you can install the demo project with old symfony version by doing:
$ symfony new blog 3.0.1
As mentioned by Cerad, you need have php7.1 or newest php version to install latest symfony demo project. But you can also have a try to install the demo project with older version by doing:
$ composer create-project symfony/website-skeleton:3.3
you can find the the release version which you need here
You just need to change your Php version from 7.02 to upper version.
I had the same issue, my path variable was pointing at php7.0., change it to php7.2. and the problem solved immediatly.
Important : Don't forget to restart you terminal.
I had a similar problem not being able to find 4.4 without php version part.
In case some one comes in contact with this (As I did), installing Symfony CLI and using it instead of direct composer, might solve the problem.
I was actually able to install Symfony 4.4 project as below
composer create-project symfony/website-skeleton:"^6.0" yourProjetName
try to specify the version 6.0
It solved my problem
I encountered this error while installing Symfony Demo App (Symfony 6). If your PHP runtime has passed symfony check:requirements, you may want to enable PDO-SQLite PHP extension or other project requirements such as the supported PHP version - Symfony Demo's Requirements.
Assuming that OP's goal is to setup and install Symphony, according to Synfony's Official Docs there are various ways one can go about doing it.
First of all, make sure one is satisfying all the requirements. For my example I will be using the most recent versions of Symphony and PHP:
Install PHP 8.1 or higher and these PHP extensions (which are
installed and enabled by default in most PHP 8 installations): Ctype,
iconv, PCRE, Session, SimpleXML, and Tokenizer;
Install Composer, which is used to install PHP packages.
Optionally, you can also install Symfony CLI. This creates a binary called symfony that provides all the tools you need to develop and run your Symfony application locally.
In this case, it seems that OP has already installed both PHP and composer, however OP might have to update the PHP version (as Cerad mentioned).
Now, depending on one's goals, there are different ways to move one:
If one is building a traditional web application open the CMD or Git Bash, and run
composer create-project symfony/skeleton:"6.1.*" my_project_directory
Then
cd my_project_directory
And
composer require webapp
If one is building a microservice, console application or API, then open the CMD or Git Bash and run
composer create-project symfony/skeleton:"6.1.*" my_project_directory
Notes:
In both cases, by specifying the version shouldn't give us the error that OP is facing.
If error keeps on appearing, would recommend using CMD or Git Bash as I've tried here and worked fine with both.
you forgot to specify the installation folder. Use a dot to install in the current folder.

How to switch php version when running composer? [duplicate]

This question already has answers here:
Tell Composer to use Different PHP Version
(26 answers)
Closed 1 year ago.
I have composer installed on windows 8.1. I use it to download drupal distributions and modules. I have also installed acquia dev desktop. As you know that dev desktop comes with different versions of php and it has separate folders for it. I have setup composer to use php 5.6. How can I make it use php 7?
Should I uninstall composer and install again or what?
IF you have multiple php version installed in your system
you can run composer with different versions like
In linux
PHP
usr/local/php usr/bin/composer install
for PHP 7.1
usr/local/php7.1 /usr/local/composer install
actually the idea is which version you wants to run get its bin path and then run the composer.
In Windows.
path/to/php.exe composer install
Hope this helps
If you just want to ignore the php version dependency then you can use this -
--ignore-platform-reqs
Example:
composer require symfony/css-selector --ignore-platform-reqs
This way you don't have to edit Environment variables(windows os) or using any full path of php etc. This very useful when I use different php lib from github which requires different php version set in my windows Environment variables though I have all PHP versions in my WAMP server so it will not be any problem running those lib after installing.
In my case worked with this:
ea-php72 /opt/cpanel/composer/bin/composer update

All-in-one PHP bundle for Ubuntu

I need to deploy Zend Framework app on Ubuntu.
I've downloaded Ubuntu desktop, installed using apt-get apache+php+mysql,
but PHP turned out to be not the latest 5.3, but 5.2.1 and even
mysql extension is missing.
I understand I can get somewhere a fresh php installation, get dependent libs (like curl or libxml2) compile them one by one and then I get full-features latest PHP bundle.
But is there anywhere already full PHP bundle with latest version and all libs to get
ZF app running very quickly?
One of the downsides of package management is that you're at the mercy of the package maintainers. Ubuntu has opted not to update to PHP 5.3 in this version, so you'll have to either wait until 2010 for it or compile PHP yourself.
Most of the PHP extensions that arent in a default source build directly from PHP are in seperate apt packages. If you do a search for PHP5 in you package manager youll see packages like:
PHP5
PHP5-Mysql
PHP5-cli
PHP5-SQLite
etc..
Im going to assume that there are also packages specifically for php 5.3 - most likely labeled as php53-* or something similar. You may need to adda repo for this as im not sure its in the crore repos.
Anyhow you need to isntall all these packages that you need to use.
I ran into similar issues getting the latest PHP on my CentOS server. I installed Zend Server Community Edition, which sets up it's own Apache/PHP5.3 stack in /usr/local/zend. And here's a Getting Started article.
It's a full PHP bundle.
If you need other packages for Ubuntu, check the ubuntu repository for PHP5 at http://bg.archive.ubuntu.com/ubuntu/pool/main/p/php5/

Categories