I have been trying for several days to deploy a Symfony site. All the files are well in the public folder with the .htaccess, I only need the dependencies for the site to be functional. The problem is that when I run the command
php composer.phar update
I get several error messages concerning my version of PHP.
The host is hostinger. I know the problem comes from the composer.json file and the version of the bundles but I don't know how to solve the problem.
Thanks
you need php version 8.1 as the message says. Normally, for a deployment you should not launch a composer update. It would rather be a composer install.
I contacted hostinger, and the problem is that the server was in PHP7 after changing to PHP8 it worked. Thank you all for your responses
Related
I made a symfony project on php 7.4, however it seems like OVH php version is 7.3.16.
Which folder are not necessary for deployment and how can I adapt my composer for a different php version ?
Here's the error I get while accessing to my website :
Fatal Error: composer.lock was created for PHP version 7.4 or higher but the current PHP version is 7.3.16.
OVH offer a way to change the PHP version used by your domain.
Check Details of the .ovhconfig file for more information about it. You should also have an option in the control panel about it.
I tried to install Simple OAuth (https://www.drupal.org/project/simple_oauth) module in my drupal site running in a shared Godaddy hosting. My first mistake was not to read the installation guide instructing to install the module by using composer. Instead, I installed the module using the Extend=>install a module link within Drupal. Installing the simple_oauth and enabling the module crashed my site and there is no output from the site.
Then I realised there is something wrong with the installation and checked the error log file. The error logged was:
PHP Fatal error: Interface 'League\OAuth2\Server\Repositories\AccessTokenRepositoryInterface' not found in /home/-----------/public_html/drupal/modules/simple_oauth/src/Repositories/AccessTokenRepository.php on line 10
At that point I realised there is something wrong with the installation and checked the module instructions which states I should use composer to install the module. I tried to solve this problem by redoing the installation from the ssh by using composer and this command:
composer config repositories.drupal composer https://packages.drupal.org/8 && composer require drupal/simple_oauth:^3
Which did not work because GoDaddy shared hosting plan has only 512mb of rams and composer kills the command because of lack of memory.
I tried reading through and understand how Composer works. There were recommendations saying you should never use composer in a production site and you should run it on your computer and copy the composer.lock file which needs much less rams. I created a PHP server using XAMMP on my computer and copied the composer.json file to my computer and run composer update command in my computer. It downloaded the dependencies and stuff on my computer. And feeling I get the hang of it, I copied the composer.lock file in my drupal server, run composer update command and saw composer delete many stuff which I could not undo.
So my questions are: 1- Is there a way of rescuing this drupal site at this point? I deleted many composer dependencies as far as I can understand.
The new error log says: PHP Fatal error: Interface 'Symfony\Component\HttpKernel\HttpKernelInterface' not found in /home/--------/public_html/drupal/core/lib/Drupal/Core/DrupalKernelInterface.php on line 15
2- If not, which is fine as I was just beginning to setup the site. Is it possible for someone to explain the best way of handling this scenario? I mean installing a module using composer in a memory critical place. Or explain how composer works for layman. I read about all the dependency stuff but could not figure out how to use it for this scenario.
Thanks.
Please I need help on this project, I have wamp server to run the project on symphony.Look at the error display on my web browser ,when load the project from wamp server
If I run this code from my command prompt see the results php app/check.php
If I run this code from my command prompt see the results php app/check.php
php app/console server:run
It looks like you also have XAMPP installed on your system, or did at one time.
See the line that says
Configuration file used in PHP : C:\xampp\php\php.ini
^^^^^
I would suggest that you check your Windows PATH. I guess XAMPP might have added it's own PHP version into the PATH.
Alternatively you could uninstall XAMPP, but make sure you back everything up, code/databases etc before you uninstall it.
WAMPServer does not need anything placed on the Windows PATH, and if you do it makes switching versions of PHP far more complicated and prone to mistakes.
Have a look at this answer for how to make the PHP CLI as flexible as WAMPServer when it comes to running PHP code on different versions of PHP from the command line.
It also looks like you have not istalled composer. Follow the instructions on how to instal composed from the error messages. Or have a look at the composer site for help
I am trying to install assets on my sylius project, and I am facing problem :
COMMAND: php app/console sylius:install:assets
ERROR AFTER EXECUTING COMMAND: This command terminated with a permission error
I found solution of a problem, before you guys try to install assets be sure to clear cache, but you might get into a trouble with memory, so edit your
app/console file and add ini_set('memory_limit','-1');
and after that run cache clear, and install assets and everything will be fine :)
I am trying to install Sylius - Open Source E-Commerce based on Symfony2 from this link
The composer can successfully pull the project files from github but while updating vendors i get this error
[UnexpectedValueException]
'C:\wamp\www\sylius\vendor/liip/imagine-bundle/Liip/ImagineBundle/3e0aa0b8b
218dab8fc7a752ff6d3a41e.4' is not a zip archive.
I have zip and git installed on my system.
Please help with your solutions and suggestions. Thanks in advance.
Ok..so i did this
I cleared the cache from the project folder and ran the command:
php composer.phar update
And now all seems to be working fine without any error. All vendors successfully updated and downloaded the remaining ones.
Hope this helps someone