小编Yal*_*ram的帖子

Wordpress w3total 缓存:磁盘、Opcache 或内存缓存

我有一个 wordpress 网站,每天有大约 200.000 页的浏览量。我在具有 6GB 内存的 VPS 上运行它。我现在安装了 w3total 缓存,但页面加载速度仍然很慢。

我现在想知道的是我应该为我的站点磁盘、Opcache 或 memcache 使用什么缓存,我应该在 alla 上使用一个缓存还是应该如何设置它?目前我只使用基本磁盘缓存。

我的问题基本上是,我应该改变什么,如果是什么?还是我应该坚持使用基本的磁盘缓存?

我还没有尝试改变任何东西,所以我不会让它变得更糟,因为我很不确定。

wordpress w3-total-cache

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

向图像添加文本后如何保存图像

为了将文本添加到图像中,我使用来自网站的以下代码

<?php
    //Set the Content Type
    header('Content-type: image/jpeg');

    // Create Image From Existing File
    $jpg_image = imagecreatefromjpeg('sunset.jpg');

    // Allocate A Color For The Text
    $white = imagecolorallocate($jpg_image, 255, 255, 255);

    // Set Path to Font File
    $font_path = 'font.TTF';

    // Set Text to Be Printed On Image
    $text = "This is a sunset!";

    // Print Text On Image
    imagettftext($jpg_image, 25, 0, 75, 300, $white, $font_path, $text);

    // Send Image to Browser
    imagejpeg($jpg_image);

    // Clear Memory
    imagedestroy($jpg_image);
?> 
Run Code Online (Sandbox Code Playgroud)

它运行良好,但我无法保存在图片中以保存文本文件我正在使用此功能

function write($post,$myFile){ …
Run Code Online (Sandbox Code Playgroud)

php gd

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

我如何用PHP找到丢失的数字

我有一个像914027这样的数字,现在我想找到6位数中缺少的数字,例如:该数字中缺少3,5,6,8.我有300个数字,所以不容易找到,这就是我想用代码做的原因

$str = '914027';
$one=$str[0];
$two=$str[1];
$three=$str[2];
$four=$str[3];
$five=$str[4];
$six=$str[5];
Run Code Online (Sandbox Code Playgroud)

php

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

标签 统计

php ×2

gd ×1

w3-total-cache ×1

wordpress ×1