小编Arm*_* P.的帖子

GitLab-CI Multi Runner php composer cache

我正在使用带有docker容器的gitlab-ci-multi-runner.一切都很顺利,但是docker容器没有保留composer缓存,所以在每次运行中composer一次又一次地下载依赖关系,这需要花费很多时间.有没有办法配置gitlab-ci-runnerdocker容器来保持composer缓存或在保存缓存的每次运行中挂载卷composer

php gitlab composer-php docker gitlab-ci-runner

21
推荐指数
2
解决办法
7300
查看次数

Ansible命令的返回值

我试图找到Ansible命令的返回值,以便我可以在Ansible Playbooks中更好地编程.以stat为例.我没有看到文档中列出的任何返回值. http://docs.ansible.com/stat_module.html

然而,我可以通过执行adhoc命令找到它们.有没有更好的办法?也许它们没有记录,因为它在每个实例中都是特定于OS的.

例如:

ansible 12.34.56.78  -m stat -a "path=/appserver"
12.34.56.78 | success >> {
"changed": false,
"stat": {
    "atime": 1424197918.2113113,
    "ctime": 1423779491.431509,
    "dev": 64768,
    "exists": true,
    "gid": 1000,
    "inode": 9742,
    "isblk": false,
    "ischr": false,
    "isdir": true,
    "isfifo": false,
    "isgid": false,
    "islnk": false,
    "isreg": false,
    "issock": false,
    "isuid": false,
    "mode": "0755",
    "mtime": 1423585087.2470782,
    "nlink": 4,
    "pw_name": "cloud",
    "rgrp": true,
    "roth": true,
    "rusr": true,
    "size": 4096,
    "uid": 1000,
    "wgrp": false,
    "woth": false,
    "wusr": true,
    "xgrp": true,
    "xoth": true, …
Run Code Online (Sandbox Code Playgroud)

ansible

10
推荐指数
1
解决办法
1万
查看次数

使用.htaccess删除.html和.php扩展名

如何在不创建新目录并命名文件index.php的情况下从网页中删除文件类型.我想http://example.com/google.html访问http://example.com/google.

我该怎么做呢

PS:我试过看一些其他的教程,但那里令人困惑.我现在可以在.htaccess中完成它

html .htaccess mod-rewrite rewrite

9
推荐指数
2
解决办法
3万
查看次数

Yii在查询时限制相关模型

我遇到了限制问题.我正在使用的代码如下:

$model = PostCategory::model();
  $record = $model->with(array(
    'posts'=>array(
      'order'=>'posts.createTime DESC',
      'limit'=>3,
))->findByPK($id);
Run Code Online (Sandbox Code Playgroud)

我想限制为查询目的查询的帖子.我也尝试过添加

'together'=>true
Run Code Online (Sandbox Code Playgroud)

在限制之后,这也没有帮助.

任何帮助表示赞赏.

php sql limit yii

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

找出流块是否是最后一个

在转换函数中编写 NodeJS 转换流时,我如何知道块是最后一个还是没有任何新块到来。

_transform(chunk: any, encoding: string, callback: Function): void {
    // accumulating chunks here to buffer
    // so that I need to do some processing on the whole buffer
    // and I need to understand when to do that
}
Run Code Online (Sandbox Code Playgroud)

所以我需要知道进入 Stream 的块何时结束,对由所有块组成的缓冲区进行一些处理,然后从流中推送处理后的数据。

javascript node.js typescript

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

使用jQuery检测水平滚动div的结束

所以,我在div中得到了一些数据.它按日期分成几块.它使用jQuery和mousewheel插件水平滚动.

当div达到它的终点(最左边,最右边)时,我需要发射一个事件.我认为通过检测鼠标滚动插件中获取的数据,可以通过当前实现的方式来计算何时无法进一步滚动.我只需要朝着正确的方向轻推.这是为我进行水平滚动的代码:

$(document).ready(function () {        
    $('#timeline').mousedown(function (event) {
        $(this)
            .data('down', true)
            .data('x', event.clientX)
            .data('scrollLeft', this.scrollLeft);
        return false;
    }).mouseup(function (event) {
        $(this).data('down', false);
    }).mousemove(function (event) {
        if ($(this).data('down') == true) {
            this.scrollLeft = $(this).data('scrollLeft') + $(this).data('x') - event.clientX;
        }
    }).mousewheel(function (event, delta) {
        this.scrollLeft -= (delta * 30);
    }).css({
        'overflow' : 'hidden',
        'cursor' : '-moz-grab'
    });
});
Run Code Online (Sandbox Code Playgroud)

有人可以给我指点吗?谢谢!

jquery scroll mousewheel

4
推荐指数
2
解决办法
2万
查看次数

无法设置php_value'soap.wsdl_cache_dir'

我有运行Apache 2.2.4和PHP-FPM(FastCGI Process Manager)的VPS服务器(CentOS 6.5).查看php-fpm error_log我发现每个spawn php-fpm子进程都出错了:

WARNING: [pool www] child 24086 said into stderr: "ERROR: Unable to set php_value 'soap.wsdl_cache_dir'"
Run Code Online (Sandbox Code Playgroud)

我找不到关于此警告谷歌搜索的任何信息.有人知道这意味着什么以及如何摆脱这种警告?

更新1:

apache的fastcgi.conf:

User apache                                                                                                                             
Group apache                                                                                                                            

LoadModule fastcgi_module modules/mod_fastcgi.so                                                                                        

<IfModule mod_fastcgi.c>                                                                                                                
    DirectoryIndex index.php index.html index.shtml index.cgi                                                                       
    AddHandler php5-fcgi .php                                                                                                       
    # For monitoring status with e.g. Munin                                                                                         
    <LocationMatch "/(ping|status)">                                                                                                
            SetHandler php5-fcgi-virt                                                                                               
            Action php5-fcgi-virt /php5-fcgi virtual                                                                                
    </LocationMatch>                                                                                                                

    Action php5-fcgi /php5-fcgi                                                                                                     
    Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi                                                                                     
    FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -socket /tmp/php5-fpm.sock -pass-header Authorization                          
</IfModule>

# global FastCgiConfig can be overridden by FastCgiServer options in …
Run Code Online (Sandbox Code Playgroud)

php apache soap fastcgi

4
推荐指数
1
解决办法
9784
查看次数

php调整大小图像然后裁剪图像问题

我想将图片尺寸从600px*500px缩小到60px*50px,然后裁剪成50px*50px.我有两组代码,一组是缩小图像大小,另一组是裁剪图像.问题是它们是分开工作的,如何将这两组代码结合起来使它们一起工作?以下是我的代码:

<?php

//codes of group A - Reduce the size of image from 600px * 500px to 60px * 50px   
    $save2 = "images/users/" . $image_name_2; //This is the new file you saving
    list($width2, $height2) = getimagesize($file) ; 
    $modwidth2 = 50; 
    $diff2 = $width2 / $modwidth2;
    $modheight2 = $height2 / $diff2; 
    $tn2 = imagecreatetruecolor($modwidth2, $modheight2) ; 
    $image2 = imagecreatefromjpeg($file) ; 
    imagecopyresampled($tn2, $image2, 0, 0, 0, 0, $modwidth2, $modheight2, $width2, $height2) ; 
    imagejpeg($tn2, $save2, 100) ; 



//codes of group B - Crop …
Run Code Online (Sandbox Code Playgroud)

php gd crop image-resizing

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

FastCGI:aborted:select()失败

我有运行Apache 2.2.4和PHP-FPM(FastCGI Process Manager)的VPS服务器(CentOS 6.5).每天2-3次我得到以下错误error_log:

[error] [client 127.60.158.1] (4)Interrupted system call: FastCGI: comm with server "/usr/lib/cgi-bin/php5-fcgi" aborted: select() failed
[error] [client 127.60.158.1] FastCGI: incomplete headers (0 bytes) received from server "/usr/lib/cgi-bin/php5-fcgi"
[notice] caught SIGTERM, shutting down
[alert] (4)Interrupted system call: FastCGI: read() from pipe failed (0)
[alert] (4)Interrupted system call: FastCGI: the PM is shutting down, Apache seems to have disappeared - bye
Run Code Online (Sandbox Code Playgroud)

因此,apache并不总是停止,有时只有主进程停止并且工作进程仍然运行,这使我甚至无法重启apache,因为它仍在侦听端口80,但没有主进程和pid文件.

我看到有人提到要更新到mod_fastcgi 2.4.7(修补)修复了这个bug,但不幸的是RHEL/CentOS没有更新,所以这对我来说不是一个选项.(Apache PHP5-FPM连接由同行重置)

谷歌的答案还有线程,--idle-timeout在fastcgi.conf 中增加价值可以解决问题,但我没有看到原因.

请问这个问题的解决方案吗?

php apache fastcgi

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