我是 Docker 的新手,我正在尝试安装 PHP GD扩展。
这是我当前的 Dockerfile:
FROM php:7.4-fpm-alpine
RUN docker-php-ext-install mysqli pdo pdo_mysql bcmath gd
Run Code Online (Sandbox Code Playgroud)
通过运行 docker 时docker-compose build && docker-compose up -d出现很多错误,最后我收到以下消息:
configure: error: Package requirements (zlib) were not met:
Package 'zlib', required by 'virtual:world', not found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables ZLIB_CFLAGS
and ZLIB_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more …Run Code Online (Sandbox Code Playgroud) 我有一个带有多个选项的html select元素,当选定的javascript将显示特定的输入字段时。在这些字段中,我具有将逗号(,)更改为点(。)的javascript函数。
问题是,只有id为id的输入字段才#size可以使用,选择其他字段后,什么都不会改变。我正在使用jQuery。
<select id="switch" name="switch">
<option value="">Select...</option>
<option value="size">Size</option>
<option value="weight">Weight</option>
<option value="dimensions">Dimensions</option>
</select>
<div class="switch-body">
<!-- javascript content goes here -->
</div>
Run Code Online (Sandbox Code Playgroud)
Javascript:
$(document).ready(function() {
$("#switch").change(function() {
//if selected option is size
if ($(this).val() == "size") {
$(".switch-body").html('<input type="text" id="size" placeholder="Product Size">');
}
//if selected option is weight
else if ($(this).val() == "weight") {
$(".switch-body").html('<input type="text" id="weight" placeholder="Product Weight">');
}
//if selected option is weight
else if ($(this).val() == "dimensions") {
$(".switch-body").html(`
<input type="text" id="height" …Run Code Online (Sandbox Code Playgroud)