我刚刚开始使用Docker,我正在学习基本上显示以下步骤的教程:
像这样创建一个Dockerfile:
From php:7.0-apache
copy src/ /var/www/html
EXPOSE 80
从我的dockerfile构建容器:
$ docker build -t mytest .
生成图像"mytest"后,我运行它:
$ docker run -p 80 mytest
这就是我得到的错误:
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
[Sun Sep 17 16:25:12.340564 2017] [mpm_prefork:notice] [pid 1] …Run Code Online (Sandbox Code Playgroud) 情况就是这样:我有一个名为myDB.sql的2Gb转储文件.它是一个转储文件,用于删除现有数据库并使用视图和触发器创建新数据库.所以我有myDB_OLD很多行代码的字符串传播.我想将这些字符串的出现更改为myDB_NEW.我可以使用notePad ++轻松地做到这一点.但记事本不会打开2Gb文件.我所做的是一个PHP代码,它逐行读取并查找并替换我想要的字符串.
这是代码:
$myfile2 = fopen("myDB.sql", "r") or die("Unable to open file!");//Reads the file
while (!feof($myfile2)) {//Pass trough each line
$str=fgets($myfile2);//Store the line inside a variable
if (preg_match("/myDB_OLD/",$str)) {//If the string I want to change exists - replace it and conacatenate
$newStr .= str_replace("myDB_OLD","myDB_NEW",$str);
}
else {//If not concatenate it
$newStr .=$str;
}
}//End of while
fclose($myfile2);
//Save the newStr in a new file named
$myfile = fopen("newDB.sql", "w") or die("Unable to open file!"); …Run Code Online (Sandbox Code Playgroud) 在完成一些成功的项目之后,我删除了AWS-lambda内部的功能,删除了CloudWatch和IAM角色中的日志。还my-service从我的文档中删除了该文件夹。
然后,我在无服务器环境中遵循了本教程中的步骤。
现在,当我运行时:
serverless deploy --aws-profile testUser_atWork
Run Code Online (Sandbox Code Playgroud)
其中testUser_atWork是我要在AWS中连接的配置文件之一。
我收到以下错误:
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Service files not changed. Skipping deployment...
Service Information
service: my-service
stage: dev
region: us-east-1
stack: my-service-dev
api keys:
None
endpoints:
None
functions:
hello: my-service-dev-hello
//serverless.yml
service: my-service
provider:
name: aws
runtime: nodejs6.10
functions:
hello:
handler: handler.hello
Run Code Online (Sandbox Code Playgroud)
这是我的handler.js
'use strict';
module.exports.hello = (event, context, callback) => {
const response = {
statusCode: 200,
body: JSON.stringify({
message: 'Go Serverless v1.0! Your …Run Code Online (Sandbox Code Playgroud) 我是团队中的新程序员.在我的第一天,我将这个重命名的文件放在一个舞台上,准备由git提交:
$ git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: .gitignore
new file: reports/SQLS.rar
renamed: account/enter_rules.php -> enter_rules.old.php
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
deleted: account/enter_rules.old.php
Untracked files:
(use "git add <file>..." to include in what will be committed)
account/enter_rules.php
Run Code Online (Sandbox Code Playgroud)
对于前2行,我没有问题.我知道发生了什么事.但是对于最后一个改名为:,我不确定应该做些什么.该系统运作良好.
在工作目录中我有:
account/enter_rules.php
Run Code Online (Sandbox Code Playgroud)
我找不到enter_rules.old.php文件.
看起来其他程序员已经从文件中创建了一个副本,命名为.old,实际上是一些测试和新代码,而不是分阶段进行更改而忘记提交.比他手动删除了old.php
应对这种情况的最佳方法是什么?我想在开始处理它并进行自己的更改之前先把git状态清楚.
我找到了这篇文章,但我不确定我是否应该或可以在我的情况下做出承诺.在git中处理文件重命名
在阅读了所有建议后,这对我有很大帮助,这就是我所做的: …
我正在使用php 5.6 运行此Linux debian:jessie的Docker实例。
这是我的phpinfo的一部分:
如我们所见,php.ini应该位于
/usr/local/etc/php
Run Code Online (Sandbox Code Playgroud)
这就是我在/ usr / local / etc /中的内容
但是里面没有php.ini。
另一方面,我里面有php.ini
那么,究竟从哪里加载我的php.ini?
我们甚至没有运行php进程,但是php似乎还可以-在屏幕上显示phpinfo。
我想在浏览器中显示cpu槽php的负载百分比。这是我正在使用的代码:
$command ="C:\\wmic cpu get loadpercentage";
echo shell_exec("$command 2>&1 ; echo $?" );
Run Code Online (Sandbox Code Playgroud)
这是输出:
'C:\wmic' is not recognized as an internal or external command, operable program or batch file.
Run Code Online (Sandbox Code Playgroud)
我想念什么?
更新-1
更改代码以在单词之间留空格:
$command ="C:\\wmic^ cpu^ get^ loadpercentage";
'C:\wmic cpu get loadpercentage' is not recognized as an internal or external command, operable program or batch file.
Run Code Online (Sandbox Code Playgroud)
现在正在读取整行代码,不仅是'C:\ wmic'
我正在关注这个无服务器快速入门教程。在这里,我看到我必须拥有Serverless CLI v1.9.0 or later. 跑$ serverless -v然后我有//1.28.0。在无服务器 gitHub 中,我看到当前版本是1.28.0 (04.07.2018). 和我的一样。
如何检查我的无服务器 cli 版本?Maye 另一个可以显示 1.9.0 的命令。我正在运行 Ubuntu 16.04。
现在,如果我们想让一个 lambda 函数调用另一个函数,我们可以使用 AWS StepFunctions。但是现在我需要支持在 StepFunctions 时间之前编写的生产代码。出于这个原因,我需要了解它是如何工作的。我试图创建一个非常简单的 lambda 调用另一个 lambda 函数 trough AWS-SDk。
我有以下 serverless.yml
service: lambdaCallLambda
provider:
name: aws
runtime: nodejs6.10
functions:
hello:
handler: handler.hello
funcOne:
handler: handler.funcOne
funcTwo:
handler: handler.funcTwo
#Must install aws-sdk. #npm install --save aws-sdk
Run Code Online (Sandbox Code Playgroud)
这是 handler.js:
'use strict';
//https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html
var Lambda = require('aws-sdk/clients/lambda');
module.exports.hello = (event, context, callback) => {
const response = {
statusCode: 200,
body: JSON.stringify({
message: 'hello',
input: event,
}),
};
callback(null, response);
};
module.exports.funcOne = (event, context, callback) => { …Run Code Online (Sandbox Code Playgroud) 我在 MacOS 中使用 Flutter 和 VSCODE。刚刚MobileHomePage.dart从AdobeXD导入了一个文件,文件名是红色的 - 这意味着这个文件中存在一些错误。

我跟着这个教程。在 5:33,它表明我应该在>和 中添加以下包(adobe_xd: ^0.1.4和flutter_launcher_icons: "^0.7.3")。现在这就是我所拥有的:pubspec.yamldependencies:dev_dependencies:
dependencies:
flutter:
sdk: flutter
adobe_xd: ^0.1.4
flutter_launcher_icons: "^0.7.3"
cupertino_icons: ^0.1.3
dev_dependencies:
flutter_test:
sdk: flutter
adobe_xd: ^0.1.4
flutter_launcher_icons: "^0.7.3"
Run Code Online (Sandbox Code Playgroud)
根据视频,此时VSCode应该会自动解决问题(将颜色转入)。它没有发生。我仍然有红色的颜色。
挖掘文件内部MobileHomePage.dart我有一个错误import 'package:adobe_xd/pinned.dart';
Target of URI doesn't exist: 'package:adobe_xd/pinned.dart'.
Try creating the file referenced by the URI, or Try using a URI for a file that does exist.darturi_does_not_exist
Run Code Online (Sandbox Code Playgroud)
我试图在flutter/adobe_xd包中找到这个库,但它不存在。
~/Documents/vhosts/flutter/.pub-cache/hosted/pub.dartlang.org/adobe_xd-0.1.4/lib(stable)$ ll …Run Code Online (Sandbox Code Playgroud) 我正在尝试将 Chrome Incognito 设置为默认浏览器,但我不知道如何执行此操作。我正在运行 NetBeans 8.0.2。任何想法?
php ×3
docker ×2
adobe-xd ×1
apache ×1
aws-lambda ×1
browser ×1
deployment ×1
file-rename ×1
flutter ×1
git ×1
ini ×1
netbeans-8 ×1
string ×1
ubuntu-16.04 ×1
variables ×1
version ×1
windows ×1