小编vik*_*iko的帖子

Docker 中的 Xdebug CLI

我在 GitHub 和 StackOverflow 上读了很多帖子,但没有找到答案。

我有带有 PHP 7.4 和 Xdebug 3 的 Docker 容器。IDE 是 PhpStorm。当我在浏览器中使用 Xdebug 时,Xdebug 工作正常。但是当我在容器中使用 PHP CLI 时,Xdebug 不起作用。

xdebug.ini:

zend_extension=xdebug.so

[xdebug]
xdebug.mode = debug
xdebug.client_port = 9003
xdebug.discover_client_host = 1

xdebug.remote_log=/var/log/xdebug.log
Run Code Online (Sandbox Code Playgroud)

我从容器连接 bash:docker exec -it CONTAINER_NAME bash 并运行例如:bin/console my:command(Symfony)。没有结果,当我添加到配置时xdebug.start_with_request = yes,我可以看到警告:

Xdebug: [Step Debug] Could not connect to debugging client. Tried: localhost:9003 (fallback through xdebug.client_host/xdebug.client_port) :-(
Run Code Online (Sandbox Code Playgroud)

看起来容器无法与我的主机系统连接,其中 PhpStorm 开放了 9003 端口。但是当在网络服务器上使用相同的配置时它可以工作......

root@31aab3e484e1:/var/www/symfony# php -v
PHP 7.4.13 (cli) (built: …
Run Code Online (Sandbox Code Playgroud)

xdebug phpstorm docker

9
推荐指数
1
解决办法
4293
查看次数

jQuery-File-Upload mysql select显示所有文件,而不仅仅是用户的文件

欢迎,

我有jQuery-File-Upload的问题.我将插件与MySQL集成 - > https://github.com/blueimp/jQuery-File-Upload/wiki/PHP-MySQL-database-integration当我将文件添加到数据库中时添加了记录:name file, id_user, active...这很好.

加载我的网站后,加载列表上传的文件:https://stackoverflow.com/a/15448692/2788495

我只想加载当前加载所有的用户文件.

jQuery代码:

    $.ajax({
// Uncomment the following to send cross-domain cookies:
//xhrFields: {withCredentials: true},
url: $('#fileupload').fileupload('option', 'url'),
    dataType: 'json',
    context: $('#fileupload')[0],
    formData:{
        user: '<?php echo $objSession->e_ident ?>'
    }
}).done(function (result) {
    $(this).fileupload('option', 'done')
        .call(this, null, {result: result});
});
Run Code Online (Sandbox Code Playgroud)

PHP:

protected function handle_form_data($file, $index) {
    $file->title = @$_REQUEST['title'][$index];
    $file->description = @$_REQUEST['description'][$index];
    $file->user=@$_REQUEST['user'];
}
    protected function set_additional_file_properties($file) {
    parent::set_additional_file_properties($file);
    if ($_SERVER['REQUEST_METHOD'] === 'GET') {
        $sql = 'SELECT …
Run Code Online (Sandbox Code Playgroud)

php mysql jquery jquery-file-upload

5
推荐指数
1
解决办法
945
查看次数

无业游民+许可被拒绝

我只和它战斗了两天。我看到许多类似的帖子,但我无法解决我的问题。

我将Mint 18作为主要操作系统(4.4.0-21-通用#37-Ubuntu SMP Mon Apr 18 18:33:37 UTC 2016 x86_64 x86_64 x86_64 GNU / Linu),现在我拥有:

  • 的VirtualBox 5.0.40 R115130

  • 流浪者1.8.4 +流浪者-vbguest(0.14.2)

Vm正确安装。当我尝试运行“ vagrant ssh”时,我看到:

Permission denied (publickey)
Run Code Online (Sandbox Code Playgroud)

我的配置:

Vagrant.configure(2) do |config|
  config.vm.box = "debian/jessie64"
  config.vm.network "forwarded_port", guest: 80, host: 8080, auto_correct: true
  config.vm.network "private_network", ip: "192.168.56.106"
  config.vm.synced_folder '.', '/home/vagrant'  
end
Run Code Online (Sandbox Code Playgroud)

Synced_folder正常工作。

流浪者ssh-config

 Host default
  HostName 127.0.0.1
  User vagrant
  Port 2222
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile /home/wiktor/NetBeansProjects/PhpProject1/.vagrant/machines/default/virtualbox/private_key
  IdentitiesOnly yes
  LogLevel FATAL
Run Code Online (Sandbox Code Playgroud)

并且:ssh -i /home/wiktor/NetBeansProjects/PhpProject1/.vagrant/machines/default/virtualbox/private_key -v vagrant @ localhost -p …

vagrant vagrantfile

2
推荐指数
1
解决办法
2305
查看次数