how to install composer for stripe payment in php? - php

I want to install composer on mounted folder in localhost /opt/lampp/htdocs/myProject
But I am unable to do it.
Because on my mac terminal cd /opt/lampp/htdocs/myProject command not working it says
-bash: cd: /opt/lampp/htdocs/myProject: No such file or directory
While the project exist. Below is the project full path:
nfs://192.168.64.2/opt/lampp/htdocs/myProject
The project is in the localhost xampp. And I have to mounted and explore whenever I need to open myProject.
I tried many things but terminal always says no such file or directory exits and I am not able to install composer.phar, composer.json in my project.
Kindly suggest what I am doing wrong.

Related

require(/var/www/bajwa-crm/vendor/composer/../symfony/polyfill-ctype/bootstrap.php): failed to open stream: No such file or directory

My project is working fine on local but when I am uploading it on server then it is showing this error dont know what is this.
I had the same problem when I have had migrated a drupal website to new server...
To solve the problem I just used the composer command:
First cd into website directory, EX:
cd /var/www/your_website
Run composer to install drupal 8 dependencies that it's need in the website directory;
composer install
If you use the sudo command, make sure the .../vendor directory has the right permission to be accessed by the user who in the /var/wwwdirectory;
sudo composer install

yii2 not installing with correct permissions with composer

I am running windows 10 with the ubuntu subsystem installed as my localhost. I have composer installed on that and when I try to install the yii2 basic application it goes through the process correctly but when i open the yii2 basic application in my browser I get:
Failed to change permissions for directory "/mnt/c/Users/andre/zype/staff-tools/web/assets/89851207": chmod(): Operation not permitted
If I then change permissions on the yii2 installation file structure with
sudo chown -R www-data:www-data .
the application loads but the web/assets folders are missing so my application has no styling. I am unsure if this is a composer issue or a yii2 issue but it looks like permissions to me.
Try changing the permission of 'assets' folder most likely to 777 (all users can access this file)
your-project/web/assets
Well this solution works for Linux users. Will require to check for windows
Follow Steps
Step 1- Install Composer (I installed it through bash)
Step 2- Now in cmd use following command
composer create-project --prefer-dist yiisoft/yii2-app-basic yii2-basic-check
Output (Last Lines)-
chmod('runtime', 0777)...done.
chmod('web/assets', 0777)...done.
chmod('yii', 0755)...done.
Step 3 - Open "http://localhost/yii2-basic-check/web/" URL in browser.
It worked fine for me
Important: Windows Subsystem for Linux has many serious problems with file permission. So, I advise not to install Linux programs and it's files in Windows drives i.e. DRVFS (/mnt/c). Also as PHP frameworks need many files, it will be better if you install distributions in another internal NTFS drives other that C:\ drive.
Steps: Place/clone the required project files/repositories in current user's home folder e.g. /root, /home, /home/user. Do not place the files in C:\ drive aka. /mnt/c otherwise WSL will not follow their permissions correctly. Here is an example of the installation procedure from YiiFramework: The Definitive Guide to Yii 2.0.
Install required packages: sudo apt-get install php php-cli php-common php-mbstring php-xml php-zip zip unzip
Go to user folder: cd ~
Download composer: curl -sS https://getcomposer.org/installer | php
Install yii2-basic: ~/composer.phar create-project --prefer-dist yiisoft/yii2-app-basic basic
Go to project folder: cd ~/basic
Run PHP server: php yii serve
Open server in browser at localhost:8080 (default port 8080).

Laravel - Installing packages that were installed with composer on live server

I have a laravel project on namecheap shared server, I have set up everything and it is working there. But after that, I have added locally on my machine to the project imagecache intervention package with composer. I don't know how to install it on the server though, I have tried with running composer commands through ssh:
php composer require intervention/imagecache
But I got an error:
Could not open input file: composer
Since, their support told me that they actually have composer uploaded in the folder public_html and not where my project is and that is public_html/myProject if that is the problem. Since I have no idea, how the composer is installed and setup there, I wonder how can I install this package. I have also tried by just uploading the whole directory of the package from my local vendor folder in the project to the production server, but that didn't work either, images were still not visible when I was using imagecache route. How can I fix that?
Run this: php -c php.ini composer.phar install
First You have to create php.ini file with this info.
max_execution_time = 300
max_input_time = 300
memory_limit = 512M
suhosin.executor.include.whitelist = phar
detect_unicode = Off
If you have ssh then you can create a folder where ever you wan't.
It is better if you put it in the same level that your public folder and then install composer inside this folder:
with curl
curl -sS https://getcomposer.org/installer | php
if you don't have curl or the server has restrictions you can use:
php -r "readfile('https://getcomposer.org/installer');" | php
or you can "Manual Download" the composer.phar and upload it trough ftp
https://getcomposer.org/download/
Then you need to give execution rights to the composer.phar file and you
chmod a+x composer.phar
can also create an alias to run composer from your public folder
alias composer="path/to/composer/composer.phar"
This alias will work until you close your console. In some shared servers you will see a file call: .bashrc where you can put the alias

Laravel homestead is setup and works. But can't find files created

I've just got my new Macbook Pro, and installed Homestead on it. Followed this link: https://laravel.com/docs/master/homestead
I can view the site after installing Laravel on Homestead, but can't find where the files created are on my computer.
Here's homestead.yaml file
My browser
Code Folder
To check for any hidden files I've tried the same on Terminal
When I ssh into the Vagrant instance, I can see the file.
Where could the files be stored? Or am I looking at the wrong place? Thanks
I was able to fix it using the following steps.
I ran vagrant provision from the Homestead directory.
I was able to access the mac Code folder from ssh:
ssh vagrant#192.168.10.10
cd /home/Code
Just had to install Laravel again in this directory.
I think by default it is in your User folder. Mac HD/Users/yourname/Code
Check your command by which you create the project. It looks like:
$composer create-project laravel/laravel --prefer-dist your_project_name
If no error occurs, a directory named your_project_name would be created under your Code path.
Good luck!

Blank page with php artisan serve for laravel 5 in mamp php 5.4.10

I am trying to install Laravel for first time. I installed it on my desktop with the following composer command
composer create-project laravel/laravel laravel-app
The command completed successfully without any error but with some messages like
symfony/var-dumper suggests installing ext-symfony_debug ()
symfony/translation suggests installing symfony/config ()
I now did chmod -R 777 larvel-app to make whole folder writable by everyone. I now started php server with following command
cd laravel-app
php artisan serve
and it gave following message
Laravel development server started on http://localhost:8000
When viewed from web browser in address http://localhost:8000, there is nothing, only blank page. When I browse this address, the server seems to quit.
I have following environment:
OSX Mavericks;
MAMP with php 5.4.10 and apache2;
following extensions in php.ini file
extension=imap.so
extension=yaz.so
extension=mcrypt.so
extension=gettext.so
extension=pgsql.so
extension=pdo_pgsql.so
extension=pdo_mysql.so
;;;;;Following are added by me ;;;;no error when starting server
extension=openssl.so
extension=mbstring.so
When I run which php from command line, I get following.
/Applications/MAMP/bin/php/php5.4.10/bin/php
When I tried to run this in mamp ie localhost:8888, it gave 500 internal server error.
Please suggest me, where I might have made mistake.
As a OSX user i strongly recommend you to use Laravel Homestead to develop your applications.
http://laravel.com/docs/5.0/homestead
You only need to install:
Virtualbox
Vagrant
I have my projects in ~/code folder, so everytime i create a new project, i just:
Add project test domain to my local host file (my-project.app pointing to localhost 127.0.0.1)
ssh into the homestead virtualmachine (homestead ssh)
run built in serve command (serve my-project.app /path/to/project/public)
VoilĂ 
The most common reason for this is that the web server process does not have write access to the storage folder and its subfolders.
Set the permissions on the storage folder so that the web server can create files.
You don't have to use php serve, mamp does that for you. Make sure you point your directory to public folder. You can also use custom domain for each of your projects.
Also for Mac there is laravel valet. Easy to get started with many php projects.
I think you should move your Laravel Application to
/Applications/MAMP/htdocs/
and then you can access it on
http://localhost:8888/laravel-app

Categories