I am running Laravel on Homestead, and whenever I run any php artisan XXX command, the file named -1 is created in the root directory of the app.
Contents of the file are similar to these ones:
Log opened at 2017-12-22 13:54:00
I: Connecting to configured address/port: 10.0.2.2:9000.
E: Time-out connecting to client. :-(
Log closed at 2017-12-22 13:54:00
I am 99% sure it is related some changes I made in my failed attempts to make XDebug breakpoints work with artisan commands. I have exported some shell variables, as recommended in this answer, but when I run export -p I don't see any of them.
Did anyone have a similar issue? What setting can be causing such behavior?
Following the suggestion of LazyOne, I found the answer:
It seems that paths in .ini file have to be absolute. So instead of:
xdebug.remote_log=~/code/xdebug.log
I had to set it to:
xdebug.remote_log=/home/vagrant/code/xdebug.log
and now it works as supposed to.
Related
I want to create a new project in PhpStorm, but I can't figure out why I can't add a PHP Interpreter in PhpStorm 2020.1.1.
First some info:
All is starting from my Synology NAS DS415+ with latest DSM 6.2.3-25426.
Installed on NAS:
Web Station
MariaDB 10
phpMyAdmin
PHP 7.2
PHP 7.3
Apache HTTP Server 2.4
SSH-connection is added successfully in PhpStorm.
Z-driveletter is /web-folder.
So, first things first. I created a /composer folder inside my /web folder. Composer.phar is selected in path as you can see.
Then I would select a PHP Interpreter.
I will add a new interpreter, so I click on +-sign.
Because of all is installed on my NAS, I select "From Docker, Vagrant, VM, WSL,Remote,..."
Then I select SSH because I can access my NAS through SSH.
Within SSH configuration I select mine. Test Connection => Successfully connected!
Now, I needed to enter the PHP interpreter path. I've searched on my NAS and found these paths:
/volume1/#appstore/PHP7.3/usr/local/bin/php73
/volume1/#appstore/PHP7.2/usr/local/bin/php72
However, I can NOT browse to these paths or enter one of these paths in the input-field.
Do or did I something wrong?
Could anyone help to get this works?
Update - 06/23/2020
I've created a phpinfo file.
What I've see is that my PHP.ini file path = C:\Windows.
I think that's not the intention? I need my NAS PHP.ini!
How can I configure this?
Update - 06/27/2020
I've created a log file that you can find over here:
2020-06-27 13:41:49,202 [13856671] DEBUG - sh.config.OpenSSHConfigService - Failed to parse OpenSSH configuration file: C:\Users\User\.ssh\config
java.io.FileNotFoundException: C:\Users\User\.ssh\config (System can't find specified file)
at java.base/java.io.FileInputStream.open0(Native Method)
at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:112)
at java.base/java.io.FileReader.<init>(FileReader.java:60)
at com.intellij.ssh.config.OpenSSHConfig.parseFile(OpenSSHConfig.java:91)
at com.intellij.ssh.config.OpenSSHConfigService.a(OpenSSHConfigService.kt:57)
at com.intellij.ssh.config.OpenSSHConfigService.a(OpenSSHConfigService.kt:52)
at com.intellij.ssh.config.OpenSSHConfigService.getConfig(OpenSSHConfigService.kt:29)
at com.intellij.ssh.RemoteCredentialsUtil.connectionBuilder(remoteCredentialsUtil.kt:33)
at com.intellij.ssh.RemoteCredentialsUtil.connectionBuilder$default(remoteCredentialsUtil.kt:27)
at com.intellij.ssh.RemoteCredentialsUtil.connectionBuilder(remoteCredentialsUtil.kt)
at com.intellij.ssh.ui.unified.SshCredentialsEditorEx$1.a(SshCredentialsEditorEx.java:68)
at com.intellij.util.RunnableCallable.call(RunnableCallable.java:20)
at com.intellij.util.RunnableCallable.call(RunnableCallable.java:11)
at com.intellij.openapi.application.impl.ApplicationImpl$1.call(ApplicationImpl.java:255)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
2020-06-27 13:41:58,050 [13865519] DEBUG - ellij.ssh.SshConnectionService - Creating sftp channel within SshjSshConnection(<crc32=1xag9ud>#<crc32=hwmx1i>)#54eb5487
2020-06-27 13:41:58,061 [13865530] WARN - net.schmizz.concurrent.Promise - <<chan#16 / open>> woke to: Opening `session` channel failed: open failed
2020-06-27 13:41:58,061 [13865530] DEBUG - ellij.ssh.SshConnectionService - Creating sftp channel within SshjSshConnection(<crc32=1xag9ud>#<crc32=hwmx1i>)#2c5f9c31
2020-06-27 13:41:58,062 [13865531] INFO - .channel.direct.SessionChannel - Will request `sftp` subsystem
2020-06-27 13:41:58,069 [13865538] WARN - net.schmizz.concurrent.Promise - <<chan#6 / chanreq for subsystem>> woke to: net.schmizz.sshj.connection.ConnectionException: Request failed
2020-06-27 13:41:58,069 [13865538] INFO - tesdk.ui.CreateRemoteSdkUIUtil - Request failed
com.jetbrains.plugins.webDeployment.CustomFileSystemException: Request failed
at com.jetbrains.plugins.remotesdk.RemoteSdkUtil.checkInterpreterAndCreateHelpersDir(RemoteSdkUtil.java:360)
at com.jetbrains.plugins.remotesdk.RemoteSdkUtil$1.lambda$run$0(RemoteSdkUtil.java:297)
at com.intellij.util.RunnableCallable.call(RunnableCallable.java:20)
at com.intellij.util.RunnableCallable.call(RunnableCallable.java:11)
at com.intellij.openapi.application.impl.ApplicationImpl$1.call(ApplicationImpl.java:255)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: com.intellij.ssh.SshTransportException: Request failed
at com.intellij.ssh.impl.sshj.SshjSshConnection.openChannel(SshjSshConnection.kt:52)
at com.intellij.ssh.impl.SshConnection.openChannel(SshConnection.kt:67)
at com.intellij.ssh.SshConnectionService.sftp(SshConnectionService.kt:171)
at com.intellij.ssh.ConnectionBuilder.openSftpChannel(ssh.kt:141)
at com.jetbrains.plugins.remotesdk.RemoteSdkUtil.checkInterpreterAndCreateHelpersDir(RemoteSdkUtil.java:356)
... 8 more
Caused by: net.schmizz.sshj.connection.ConnectionException: Request failed
at net.schmizz.sshj.connection.channel.AbstractChannel.gotResponse(AbstractChannel.java:405)
at net.schmizz.sshj.connection.channel.AbstractChannel.handle(AbstractChannel.java:192)
at net.schmizz.sshj.connection.ConnectionImpl.handle(ConnectionImpl.java:130)
at net.schmizz.sshj.transport.TransportImpl.handle(TransportImpl.java:500)
at net.schmizz.sshj.transport.Decoder.decodeMte(Decoder.java:159)
at net.schmizz.sshj.transport.Decoder.decode(Decoder.java:79)
at net.schmizz.sshj.transport.Decoder.received(Decoder.java:231)
at net.schmizz.sshj.transport.Reader.run(Reader.java:59)
Maybe that could be more informative.
I've been away from Laravel/Unix for some time but I have a project to setup and hit some snags. The most recent version of Laravel required PHP >=5.6 so I got that updated, setup my new project with laravel new project and made some modifications to the user/group permissions for storage/ and bootstrap/cache folders as normal.
I'm getting HTTP/500 error from Nginx so I checked the error log and I'm getting this in /var/log/nginx/error.log:
FastCGI sent in stderr: "PHP Message: PHP Fatal Error: Class PDO not found in /home/user/public_html/project/config/database.php on line 16" while reading upstream ... upstream: "fastcgi://unix:/var/run/php5-fpm.sock"
PHP Version 5.6.28-1~dotdeb+7.1
When I check /etc/php5/fpm/php.ini the normal extension=pdo.so and extension=pdo_mysql.so were not there so I added them to test it, however those are being requested in the conf.d folder and PHPINO shows those files being scanned/loaded.
However, later in PHPINFO results, PDO/PDO_MYSQL is not listed
UPDATE
I just attempted to use find /-name pdo.so and the same for pdo_mysql.so to find the path to those files and manually modified the loading configuration files to point to them correctly, started the server and that doesn't change anything.
I apologize this is long. I've spent a couple hours scouring to make sure I wasn't just missing something silly, and I may still be.
Any ideas overlfowers?
Well, after much consternation and fiddling I figured this one out...
There was a recursive / endless loop being created in the php-fpm.conf config as shown here:
include=/etc/php5/fpm/*.conf
This was causing PHP5-FPM .conf to attempt including itself, which I caught in a bootup error: Failed to load configuration file /etc/php5/fpm/php-fpm.conf from /etc/php5/fpm/php-fpm.conf
So I modified that to include=/etc/php5/fpm/conf.d/*.conf and everything started back up and now PDO/PDO_MSYQL is loading.
I'm deploying code to a single-instance web server AWS EB environment that will provision/update my connected RDS database. I've got an .ebextensions file that calls deployment code:
---
container_commands:
01deploydb:
command: /var/www/html/php/cli/deploy-db.php
leader_only: true
On the same deployment, I dropped the deploy-db.php file back one directory into /cli/. On deployment, I get ERROR: [Instance: i-*****] Command failed on instance. Return code: 127 Output: /bin/sh: /var/www/html/php/cli/deploy-db.php: No such file or directory.
container_command 01deploydb in .ebextensions/01_db.config failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
If I deploy a version that does not include the command, then deploy a second update including the command, there is no error. However, adding the command and the file it calls at the same time produces the error. A similar sequence occurred earlier with a different command/file.
My question is: is there a documented order/sequence for how AWS updates the environment? I would have expected that my new version would have fully deployed (and the .php file installed) before container_commands are called.
The commands: section runs before the project files are put in place. This is where you can install server packages for example.
The container_commands: section runs in a staging directory before the files are put in its final destination. Here you can modify your files if you need to. Current path is this staging directory so you can run it like this (I might get the app directory wrong, maybe it should be php/cli/deploy-db.php)
container_commands:
01deploydb:
command: cli/deploy-db.php
leader_only: true
Reference for above: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html
You can also run a post deploy scripts. This is not very well documented (at least it wasn't). You can do something like this (it won't be leader only though, but you could put a file in this directory through a container_commands:):
files:
"/opt/elasticbeanstalk/hooks/appdeploy/post/99_deploy.sh":
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env bash
/var/www/html/php/cli/deploy-db.php
I'm working on websocket. I came across this article, and simply downloaded their file and try running it in my localhost.
https://www.sanwebe.com/2013/05/chat-using-websocket-php-socket
What I understand is, they want to sue local server's websocket server.
But I have problem in starting up the server. I'm using windows 10 with wamp 2.2. As I checked webscket is enabled in my php.ini's extention.
I followed this example to cmd the right path to start it but to no avail:
https://www.sanwebe.com/2013/05/chat-using-websocket-php-socket/comment-page-1#comment-5593
It says 'php.exe' is not recognized as an internal or external ...
I then searched online again, thus set the path to my php folder in the system's environment variable. The path is: C:\wamp\bin\php. Then I closed the cmd and relaunched. Nothing worked out. The same error shows up.
This is what I did on cmd:
1) cd C:\wamp\bin\php
2) php.exe -q C:\projects\myfolder\server.php
Please help me to connect to wamp server's websocket to run the example I've downloaded.In the console, the error shown is:
WebSocket connection to 'ws://localhost:9000/demo/server.php' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
I found the answer from this site: http://rodrixar.blogspot.my/2011/07/how-to-run-php-sockets-in-wamp.html
I did the following,
1) open cmd
2) cd C:\wamp\bin\php\php5.6.19
3)php.exe -q C:\projects\mysite\server.php
4) Firewall open up and allow access for CLI
5) now connection made already..
I installed phabricator on openshift using a quickstart from github
https://github.com/CodeBlock/phabricator-openshift-quickstart
I got it running up fine, but I now have two issues:
1.) A setup issue that says apc.stat is enabled and that must be disabled in
/var/lib/openshift/my-user-hash/php/configuration/etc/php.ini
however I cannot access that with sudo command(sudo permission denied), even if I open it normally, I didn't find any apc.stat settings in the php.ini
2.) I can't figure out how set the local path for tracking repositories for diffusion. It says
I must give a path which should be read-writable by phabricator, I tried to give the persistent storage location ..data/ , but it gives me an exception as follows :
Unhandled Exception ("CommandException")
Command failed with error #1!
COMMAND
(cd '../data/' && HOME='/var/lib/openshift/my-user-hash/app-root/runtime/repo/phabricator/support/empty/' git cat-file --batch)
STDOUT
(empty)
STDERR
sh: line 0: cd: ../data/: No such file or directory
how do I fix this?
1) According to Num Duong answer, it seems like u currently could not resolve this issue, probably u should wait for openshift php.ini permissions policy changes.
Anyway this is minor non blocking issue.
2) Modify config file and re-deploy to openshift.
Look for available phabricator options here
U need smth like this: 'repository.default-local-path' => getenv('OPENSHIFT_DATA_DIR'),
P.S. Anyway there is one particular issue with phabricator on openshift that possibly never got resolved: cloning git repositories from OpenShift instances into Phabricator do not
work by SSH, due to permissions regarding the ssh configuration.