how to make SSH connection in apache - php
I trying to build a web app to manage my severs using ansible
now I using Centos 7, PHP 7.4,Laravel 8 and apache to build this app and I'm already install https://packagist.org/packages/asm/php-ansible composer package for using ansible inside of my project.
here is my code:
$ansible = new Asm\Ansible\Ansible(
'/var/www/xxx/storage/ansible',
'',
''
);
$ansible->playbook()->play($myplaybookPath)->inventoryFile($myInventoryPath)->execute(function ($type, $buffer) {
if (Process::ERR === $type) {
echo 'ERR > '.$buffer ."<br/>";
} else {
echo 'OUT > '.$buffer."<br/>";
}
});
Here is the output :
OUT > PLAY [install nano] ************************************************************
OUT > TASK [Gathering Facts] *********************************************************
OUT > fatal: [xx.xx.14.139]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).", "unreachable": true}
OUT > PLAY RECAP *********************************************************************
OUT > xx.xx.14.139 : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0
OUT >
the username and password in the inventory file is correct and I test it many times also I try with new server with a very simple password.
I google this error host via ssh: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)." and I found out its about the authorized_keys for the user that run the ssh
I change the permission and mod of the .ssh folder for my apache user in /var/user/share/httpd/.ssh
buy this error still remain and I don't know how to fix this.
thanks for help
update
it's not about my web server Configuration and everything about apache and PHP is ok.
I run my the playbook directly from terminal using ansible-playbook:
ansible-playbook /var/www/xxx/storage/ansible/playbooks/install_nano -i /var/www/xxx/storage/ansible/inventories/testInventory -vvv
I got the same error and I guess it's about the Auth information in InventoryFile
ansible-playbook 2.9.25
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible-playbook
python version = 2.7.5 (default, Nov 16 2020, 22:23:17) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]
Using /etc/ansible/ansible.cfg as config file
host_list declined parsing /var/www/xxx/storage/ansible/inventories/testInventory as it did not pass its verify_file() method
auto declined parsing /var/www/xxx/storage/ansible/inventories/testInventory as it did not pass its verify_file() method
Parsed /var/www/xxx/storage/ansible/inventories/testInventory inventory source with ini plugin
Skipping callback 'actionable', as we already have a stdout callback.
Skipping callback 'counter_enabled', as we already have a stdout callback.
Skipping callback 'debug', as we already have a stdout callback.
Skipping callback 'dense', as we already have a stdout callback.
Skipping callback 'dense', as we already have a stdout callback.
Skipping callback 'full_skip', as we already have a stdout callback.
Skipping callback 'json', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'null', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.
Skipping callback 'selective', as we already have a stdout callback.
Skipping callback 'skippy', as we already have a stdout callback.
Skipping callback 'stderr', as we already have a stdout callback.
Skipping callback 'unixy', as we already have a stdout callback.
Skipping callback 'yaml', as we already have a stdout callback.
PLAYBOOK: install nano ******************************************************************************************************************************************************************************
1 plays in /var/www/xxx/storage/ansible/playbooks/install nano
PLAY [install nano] *********************************************************************************************************************************************************************************
TASK [Gathering Facts] ******************************************************************************************************************************************************************************
task path: /var/www/xxx/storage/ansible/playbooks/install nano:2
<xx.xx.14.139> ESTABLISH SSH CONNECTION FOR USER: root
<xx.xx.14.139> SSH: EXEC sshpass -d8 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="root"' -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/a7f10d151a xx.xx.14.139 '/bin/sh -c '"'"'echo ~root && sleep 0'"'"''
<xx.xx.14.139> (255, '', 'Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).\r\n')
fatal: [xx.xx.14.139]: UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).",
"unreachable": true
}
PLAY RECAP ******************************************************************************************************************************************************************************************
xx.xx.14.139 : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0
Here is the inventory file content
[linux]
xx.xx.14.139
[linux:vars]
ansible_user=root
ansible_password=testPassword
also, I try ansible_ssh_user / password but it's not working!
Here is the solution
I enabled verbose mode in ssh connection and I notice that the outcoming SSH request didn't support Password Authentication.
There are 2 SSH config files /etc/ssh/sshd.conf for the incoming requests and /etc/ssh/ssh.cong for outcoming so I fix the issue from out coming request config file and enable the password authentication.
after that, I set permissions for my apache ssh files like keys and known hosts files.
after that, I create a command in laravel so I can run my ansible playbooks using the root user and Crond.
Related
gpg sign a file with --detach-sign in CentOS7 with SELinux enabled
My development environment is CentOS 7. SELinux is enabled in this. I am trying to sign a tgz file using gpg command with shell_exec() in my PHP code as below. $signResult = shell_exec("gpg --detach-sig --output signfile.gpg --sign InputFile.tgz 2>&1"); but I am getting the below error due to SELinux. Error: gpg: failed to create temporary file `/opt/rh/httpd24/root/usr/share/httpd/.gnupg/.#xxxx.test.com:22680': Permission denied gpg: Fatal: can't create lock for '/opt/rh/httd24/root/usr/share/httpd/.gnupg/trustdb.gpg' I want to know how to sign a file (tgz file in my case) using gpg command in PHP code which should create a signature file(signfile.gpg) apart from the input file(InputFile.tgz). or Is there a way to do it with gnupg package like, $gnupg = new gnupg(); $gnupg->setsignmode(gnupg::GNUPG_SIG_MODE_DETACH); I do not know how to proceed after these steps.
By default GnuPG looks for keyrings in the $HOME/.gnupg, and if it is empty then attempts to create basic keyring files. Which fails in this case due to permissions. To override this you shoulde use --homedir option. Also you would not be able to sign until you have some secret key file generated and stored in your keyrings.
Laravel Github Actions CI/CD - err: fatal: could not read Username for 'https://github.com': No such device or address [duplicate]
I have the following problem when I try to pull code using git Bash on Windows: fatal: could not read Username for 'https://github.com': No such file or directory I already tried to implement the accepted solution provided here: Error when push commits with Github: fatal: could not read Username However the problem still persists. After adding/removing origin I still get the same error. Could advise on this issue? Thanks!
Follow the steps to setup SSH keys here: https://help.github.com/articles/generating-ssh-keys OR git remote add origin https://{username}:{password}#github.com/{username}/project.git Update: If you get "fatal: remote origin already exists." then you have to use set-url: git remote set-url origin https://{username}:{password}#github.com/{username}/project.git
I faced the exact same problem. This problem occurred when I cloned a repo using HTTPS URL and then tried to push the changes (using Shell on Linux/Mac or Git Bash on Windows): git clone https://github.com/{username}/{repo}.git However, when I used SSH URL to clone, this problem didn't occur: git clone git#github.com:{username}/{repo}.git In case you already cloned the repo using HTTPS and don't want to redo everything, you may use set-url to change the origin URL to SSH URL: git remote set-url origin git#github.com:{username}/{repo}.git Note: I have SSH key added to my GitHub account. Without setting up SSH key, this method will not work either.
I found my answer here: edit ~/.gitconfig and add the following: [url "git#github.com:"] insteadOf = https://github.com/ Although it solves a different problem, the error code is the same...
just check the below Android Studio -> Preferences -> Version Control -> Git -> Use Credential Helper
For me nothing worked from suggested above, I use the git pull command from Jenkins Shell Script and apparently it takes wrong user name. I spent ages before I found a way to fix it without switching to SSH. In your the user's folder create .gitconfig file (if you don't have it already) and put your credentials in following format: https://user:pass#example.com, more info. After your .gitconfig file link to those credentials, in my case it was: [credential] helper = store --file /Users/admin/.git-credentials Now git will always use those credentials no matter what. I hope it will help someone, like it helped me.
If you want to continue use https instead ssh, and avoid type into your username and password for security reason. You can also try Github OAuth token, then you can do git config remote.origin.url 'https://{token}#github.com/{username}/{project}.git' or git remote add origin 'https://{token}#github.com/{username}/{project}.git' This works for me!
Note that if you are getting this error instead: fatal: could not read Username for 'https://github.com': No error Then you need to update your Git to version 2.16 or later.
This error can also happen when trying to clone an invalid HTTP URL. For example, this is the error I got when trying to clone a GitHub URL that was a few characters off: $ git clone -v http://github.com/username/repo-name.git Cloning into 'repo-name'... Username for 'https://github.com': Password for 'https://github.com': remote: Repository not found. fatal: Authentication failed for 'https://github.com/username/repo-name.git/' It actually happened inside Emacs, though, so the error in Emacs looked like this: fatal: could not read Username for ’https://github.com’: No such device or address So instead of a helpful error saying that there was no such repo at that URL, it gave me that, sending me on a wild goose chase until I finally realized that the URL was incorrect. This is with git version 2.7.4. I'm posting this here because it happened to me a month ago and again just now, sending me on the same wild goose chase again. >:(
TL;DR: check if you can read/write to /dev/tty. If no and you have used su to open the shell, check if you have used it correctly. I was facing the same problem but on Linux and I have found the issue. I don't have my credentials stored so I always input them on prompt: Username for 'https://github.com': foo Password for 'https://foo#github.com': The way how git handles http(s) connections is using /usr/lib/git-core/git-remote-https you can see strace here: stat("/usr/lib/git-core/git-remote-https", {st_mode=S_IFREG|0755, st_size=1366784, ...}) = 0 pipe([9, 10]) = 0 rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0 clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f65398bb350) = 18177 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 close(10) = 0 read(9, "", 8) = 0 close(9) = 0 close(5) = 0 close(8) = 0 dup(7) = 5 fcntl(5, F_GETFL) = 0 (flags O_RDONLY) write(6, "capabilities\n", 13) = 13 fstat(5, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0 read(5, "fetch\noption\npush\ncheck-connecti"..., 4096) = 38 write(6, "option progress true\n", 21) = 21 read(5, "ok\n", 4096) = 3 write(6, "option verbosity 1\n", 19) = 19 read(5, "ok\n", 4096) = 3 stat(".git/packed-refs", {st_mode=S_IFREG|0664, st_size=675, ...}) = 0 lstat(".git/objects/10/52401742a2e9a3e8bf068b115c3818180bf19e", {st_mode=S_IFREG|0444, st_size=179, ...}) = 0 lstat(".git/objects/4e/35fa16cf8f2676600f56e9ba78cf730adc706e", {st_mode=S_IFREG|0444, st_size=178, ...}) = 0 dup(7) = 8 fcntl(8, F_GETFL) = 0 (flags O_RDONLY) close(8) = 0 write(6, "list for-push\n", 14) = 14 read(5, fatal: could not read Username for 'https://github.com': No such device or address "", 4096) = 0 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=18177, si_uid=1000, si_status=128, si_utime=6, si_stime=2} --- exit_group(128) = ? +++ exited with 128 +++ So I tried to call it directly: echo "list for-push" | strace /usr/lib/git-core/git-remote-https my and the result: poll([{fd=3, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}], 1, 0) = 1 ([{fd=3, revents=POLLIN|POLLRDNORM}]) recvfrom(3, "\27\3\3\1\32", 5, 0, NULL, NULL) = 5 recvfrom(3, "\307|4Q\21\306\334\244o\237-\230\255\336\25\215D\257\227\274\r\330\314U\5\17\217T\274\262M\223"..., 282, 0, NULL, NULL) = 282 openat(AT_FDCWD, "/dev/tty", O_RDONLY) = -1 ENXIO (No such device or address) openat(AT_FDCWD, "/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 4 fstat(4, {st_mode=S_IFREG|0644, st_size=2995, ...}) = 0 read(4, "# Locale name alias data base.\n#"..., 4096) = 2995 read(4, "", 4096) = 0 close(4) = 0 openat(AT_FDCWD, "/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/share/locale-langpack/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/share/locale-langpack/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) write(2, "fatal: could not read Username f"..., 83fatal: could not read Username for 'https://github.com': No such device or address ) = 83 exit_group(128) = ? +++ exited with 128 +++ And here it came to me: openat(AT_FDCWD, "/dev/tty", O_RDONLY) = -1 ENXIO (No such device or address) ... write(2, "fatal: could not read Username f"..., 83fatal: could not read Username for 'https://github.com': No such device or address ) = 83 git-remote-https tries to read credentials via /dev/tty so I tested if it works: $ echo ahoj > /dev/tty bash: /dev/tty: No such device or address But in another terminal: # echo ahoj > /dev/tty ahoj I knew I switched to this user using su so I exited the shell to see how and found out I used command su danman - so I tested it again: ~# su danman - bash: cannot set terminal process group (-1): Inappropriate ioctl for device bash: no job control in this shell /root$ echo ahoj > /dev/tty bash: /dev/tty: No such device or address I probably ignored the message and continued working but this was the reason. When I switched using the correct su - danman everything worked fine: ~# su - danman danman#speedy:~$ echo ahoj > /dev/tty ahoj After this, git started working correctly
I fixed this by installing a newer version of Git. The version I installed is 2.10.2 from https://git-scm.com. See the last post here: https://www.bountysource.com/issues/31602800-git-fails-to-authenticate-access-to-private-repository-over-https With newer Git Bash, the credential manager window pops up and you can enter your username and password, and it works!
For those getting this error in a Jenkins pipeline, it can be fixed by using an SSH Agent plugin. Then wrap your git commands in something like this: sshagent(['my-ssh-key']) { git remote set-url origin git#github.com:username/reponame.git sh 'git push origin branch_name' }
Tried everything here, didn't work. However, when I tried to debug via git config --system --list, I got fatal: unable to read config file '/etc/gitconfig': No such file or directory. So I did the following, sudo ln -s $HOME/.gitconfig /etc/gitconfig and voila, it works.
Short Answer: git init git add README.md git commit -m "first commit" git remote add origin https://github.com/{USER_NAME}/{REPOSITORY_NAME}.git git push --set-upstream origin master Ignore first three lines if it's not a new repository. Longer description: Just had the same problem, as non of the above answers helped me, I have decided to post this solution that worked for me. Few Notes: The SSH key was generated SSH key was added to GitHub, still had this error. I've made a new repository on GitHub for this project and followed the steps described As the command line toolm I used GitShell (for Windows, I use Terminal.app on Mac). GitShell is official GitHub tool, can be downloaded from https://windows.github.com/
Here is the simple trick that can work android studio -> settings -> version control -> git -> use credential helper have fun
Replace your remote url like this: git remote set-url origin https://<username>#github.com/<username>/<repo>.git
[SSH] executing... fatal: could not read Username for 'https://github.com': No such device or address [SSH] completed [SSH] exit-status: 1 Build step 'Execute shell script on remote host using ssh' marked build as failure Finished: FAILURE Sol:- If the repository is private and also it belongs to another person or organisation and you are a contributor of that repository then you can run git commands from Jenkins job and it doesn't prompt you for the username and password. https://username:token#github.com/accountname/reponame.git
In my case I had to setup "personal access token" under GitHub: settings -> developer settings and enable SSO.
I am using GitHub actions where the jobs are configured to accomplish a task. This solution applies to all the CIs (Jenkins, Travis, Circle) where the git command execution environment changes. job1: Checkout the repository using the github actions actions/checkout#v2 using the personal access token(PAT), The job completed successfully and repository is cloned. job2: Fetch the tags using the command git fetch --tags. The job failed with the same error fatal: could not read Username for 'https://github.com': No such file or directory Reason of failure: When the job changed, the command running environment also changed, even though the repository exists but the github credentials needs to be provided to fetch the tags. Solution: add this command before fetching the tags in the job2 git config remote.origin.url 'https://${{ your_personal_access_token }}#github.com/${{ github.repository }}' Note: ${{ expression }} is the github actions yaml syntex to uncover the environment varibales/ to run expressions.
This is an issue with your stored credentials in the system credential cache. You probably have the config variable 'credential.helper' set to either wincred or winstore and it is failing to clear it. If you start the Control Panel and launch the Credential Manager applet then look for items in the generic credentials section labelled git:https://github.com. If you delete these, then the will be recreated next time but the credential helper utility will ask you for your new credentials.
Try using a normal Windows shell such as CMD.
Earlier when I wasn't granted permission to access the repo, I had also added the SSH pubkey to gitlab. At the point I could access the repo and run go mod vendor, the same problem as your happens. (maybe because of cache) go mod vendor go: errors parsing go.mod: /Users/macos/Documents/sample/go.mod:22: git ls-remote -q https://git.aaa.team/core/some_repo.git in /Users/macos/go/pkg/mod/cache/vcs/a94d20a18fd56245f5d0f9f1601688930cad7046e55dd453b82e959b12d78369: exit status 128: fatal: could not read Username for 'https://git.aaa.team': terminal prompts disabled After a while trying, I decide to remove the SSH key and terminal prompts filling in username and password. Everything is fine then!
Double check the repository URL, Github will prompt you to login if the repo doesn't exist. I'm guessing this is probably to check if it's a private repo you have access to. Possibly to make it harder to enumerate private repos. But this is all conjecture. /shrug
I had this problem in a ssh jail (jailkit), where /dev/tty was not present. I added this device file with jk_cp and the error went away.
I got the answer by clearing Invalidate caches and then clean build helped me. Select 'File > Invalidate Caches / Restart' and then click the 'Invalidate and Restart' button. Select Build > Clean Project and then select Build > Rebuild Project.
Here is the simple cause for people who get this error: you are trying to pull from a repo you haven't yet set up your local git to access. For me, I got this error when I changed a public repo to a private one. It's clear to me now that a public repo needs no auth, yet a private one does. Hope this helps clarify why the error occurs and one potential trigger for that cause.
From the Android Studio terminal execute git pull example: test#test:~/StudioProjects/dummy-project-android$ git pull Add the user name example: test#test:~/StudioProjects/dummy-project-android$ "username" Add the user password Password for 'https://dummy-project-android#git.com':"password" After that, we can perform the rest of the operation
If your repo is private then Instead of this format https://github.com/username/<project_name>.git Use this format git#github.username/<project_name>.git You can get a correct url under SSH option Go To Your Github Repo -> Click on Code -> Select SSH -> Copy your repo URL Hope this helps.
What worked for me is to change the access of the Git repository from private to public.
Deployer - no tty present and no askpass program specified - How to deploy with Deployer
I have trouble deploying with Deployer 4.0.2 and I am in need for help of somebody more experienced than me in this. I want to deploy a repository of mine to a Ubuntu 16.04 server. I am using laravel homestead as a development environment, where I also installed deployer. From there I ssh into my remote server. I was able to deploy my code with the root user, until I hit a RuntimeExceptionthat aborted my deployment. Do not run Composer as root/super user! See https://getcomposer.org/root for details That made me create another user called george, whom I gave superuser rights. I copied my public key from my local machine to a newly generated ~/.ssh/authorized_keys file, that gave me permission to access the server via ssh. Yet when I run dep deploy with the new user: server('production', '138.68.99.157') ->user('george') ->identityFile() ->set('deploy_path', '/var/www/test'); I get another RuntimeException: Host key verification failed. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. Now it looks like the new user george cannot access the ~/.ssh/id_rsa.pubkey. So I copy them from the root folder into my home folder and also add the public key in the Github SSH settings. cp root/.ssh/id_rsa.pub home/george/.ssh/id_rsa.pub cp root/.ssh/id_rsa home/george/.ssh/id_rsa Only to get the same error as before. In the end I had to add github to my list of authorized hosts: ssh-keyscan -H github.com >> ~/.ssh/known_hosts Only to get the next RuntimeException [RuntimeException] sudo: no tty present and no askpass program specified I managed to comment this code in the deploy.php // desc('Restart PHP-FPM service'); // task('php-fpm:restart', function () { // // The user must have rights for restart service // // /etc/sudoers: username ALL=NOPASSWD:/bin/systemctl restart php-fpm.service // run('sudo systemctl restart php-fpm.service'); // }); // after('deploy:symlink', 'php-fpm:restart'); to get the deployment process finally done, and now I ask myself, if the restart of php-fpm is really necessary, for me to continue debugging this deployment tool? Or can I live without it? And if I need it, can somebody help me understand what I need it for? And maybe as a luxury also provide the solution to the RuntimeException?
Try this: ->identityFile('~/.ssh/id_rsa.pub', '~/.ssh/id_rsa', 'pass phrase') It works great for me - no need for an askpass program. It helps to be explicit in my experience. As for your phpfm restart task .. I haven't seen that before. Shouldn't be needed. :) EDIT: That you provide a password is probably a good sign that you ought to refactor your Deployer code a bit if you keep it under source control. I am loading site specific data from a YAML file - which I am not submitting to source control. The first bit of my stage.yml : # Site Configuration # ------------- prod_1: host: hostname user: username identity_file: public_key: /home/user/.ssh/key.pub private_key: /home/user/.ssh/key password: "password" stage: production repository: https://github.com/user/repository.git deploy_path: /var/www app: debug: false stage: 'prod' And then, in my deploy.php : if (!file_exists (__DIR__ . '/deployer/stage/servers.yml')) { die('Please create "' . __DIR__ . '/deployer/stage/servers.yml" before continuing.' . "\n"); } serverList(__DIR__ . '/deployer/stage/servers.yml'); set('repository', '{{repository}}'); set('default_stage', 'production'); Notice that, when you use serverList, it replaces your server setup in deploy.php
Deploying existing local project to Bluemix BuildPack error
I hope someone can help me out with this issue I'm facing. I've made a fully functional project on a local server and would now like to deploy it to Bluemix Cloud Foundry. I've followed the tutorial: https://console.eu-gb.bluemix.net/docs/starters/upload_app.html But when I'm trying to push it through terminal with following commands cf push app_name -b https://github.com/cloudfoundry/php-buildpack.git -s cflinuxfs2 cf push app_name -b https://github.com/cloudfoundry/go-buildpack cf push app_name -c start_command cf push app_name -m 512m But non seems to work, since every single time I get the following error Staging failed: Buildpack compilation step failed -----> Composer command failed FAILED Error restarting application: BuildpackCompileFailed It is a PHP app build with PHPStorm on Symfony and Doctrine if that matters. I am fairly new to all server/setup/deployment configurations as well as command line. EDIT 1 I figured out this part thanks to this link: https://support.run.pivotal.io/entries/109600943-cf-push-ing-a-symfony-app-fails-with-Composer-command-failed- It seems that by default the buildpack assumes that you want all of the files you push to be public. Because of this assumption, it takes all of your files and moves them into the doc root of either HTTPD or Nginx. By creating the file .bp-config/options.json in the root of your project. Then inside options.json add { "WEBDIR": "web" } This will tell the buildpack that you have a specific directory to use for the doc root, so it will just use that instead of moving everything into the default doc root. However... This brings me a new issue and returns the following error FAILED Error restarting application: Start unsuccessful If i enter the recent log the terminal provides me this: 2016-08-25T02:53:40.62+0200 [App/0] OUT Could not open input file: app.php 2016-08-25T02:53:40.62+0200 [App/0] ERR 2016-08-25T02:53:40.69+0200 [DEA/211] ERR Instance (index 0) failed to start accepting connections 2016-08-25T02:53:40.72+0200 [API/9] OUT App instance exited with guid abb206b3-b8ea-4269-b248-ec7b35f7098a payload: {"cc_partition"=>"default", "droplet"=>"abb206b3-b8ea-4269-b248-ec7b35f7098a", "version"=>"b6c3c871-5484-4f12-9d84-657cf6eacfbf", "instance"=>"c11566bdabe5458d9bfc4965c9c1aa85", "index"=>0, "reason"=>"CRASHED", "exit_status"=>1, "exit_description"=>"failed to accept connections within health check timeout", "crash_timestamp"=>1472086420} 2016-08-25T02:53:40.72+0200 [API/3] OUT App instance exited with guid abb206b3-b8ea-4269-b248-ec7b35f7098a payload: {"cc_partition"=>"default", "droplet"=>"abb206b3-b8ea-4269-b248-ec7b35f7098a", "version"=>"b6c3c871-5484-4f12-9d84-657cf6eacfbf", "instance"=>"c11566bdabe5458d9bfc4965c9c1aa85", "index"=>0, "reason"=>"CRASHED", "exit_status"=>1, "exit_description"=>"failed to accept connections within health check timeout", "crash_timestamp"=>1472086420} 2016-08-24T16:41:14.03+0200 [DEA/135] OUT Starting app instance (index 0) with guid abb206b3-b8ea-4269-b248-ec7b35f7098a 2016-08-24T16:41:26.26+0200 [App/0] ERR bash: start_command: command not found 2016-08-24T16:41:26.26+0200 [App/0] OUT 2016-08-24T16:41:26.35+0200 [DEA/135] ERR Instance (index 0) failed to start accepting connections 2016-08-24T16:41:26.38+0200 [API/6] OUT App instance exited with guid abb206b3-b8ea-4269-b248-ec7b35f7098a payload: {"cc_partition"=>"default", "droplet"=>"abb206b3-b8ea-4269-b248-ec7b35f7098a", "version"=>"5ebd6d77-68c4-4901-b9a8-b5cecfa4cddb", "instance"=>"7b5b555ae68645f4a2c09b73c0adbcb3", "index"=>0, "reason"=>"CRASHED", "exit_status"=>127, "exit_description"=>"failed to accept connections within health check timeout", "crash_timestamp"=>1472049686} EDIT 2 (updated error msg)
installing php symfony installer
I am using this cmd php -r "file_put_contents('symfony', file_get_contents('https://symfony.com/installer'));" output i am getting Warning: file_get_contents(https://symfony.com/installer): failed to open stream : No connection could be made because the target machine actively refused it. in Command line code on line 1 i on proxy so that above cmd will not work directly . I found some solution on stack overflow Install Symfony on Windows behind proxy server with NTLM authentication but its not working for me I tried setting http_proxy and https_proxy env variable but it dint worked for me Are there any chances of problem because of ssl ?
Can you access https://symfony.com/installer in your browser? If you can, it'll download a PHAR file for you. This file is ready to be used. You can put this in your "projects" directory and use it as: > php symfony.phar new blog Or you can move it to a location that's in your PATH and create a bat executable file: #echo off php "C:\path\to\symfony.phar" %* Now you can use it like this: > symfony new blog