我最近将我的服务器从Debian Wheezy升级到Debian Jessie(Debian 8).许多软件包已更新,现在,我无权从http:// myIP/phppgadmin访问phppgadmin
Forbidden
You don't have permission to access /phppgadmin/ on this server.
Run Code Online (Sandbox Code Playgroud)
我尝试了很多想法解决问题,但绝对没有任何作用......
在/etc/apache2/conf.d/phppgadmin中:
Alias /phppgadmin /usr/share/phppgadmin
<Directory /usr/share/phppgadmin>
DirectoryIndex index.php
AllowOverride None
order allow,deny
# deny from all
allow from 127.0.0.0/255.0.0.0 ::1/128
allow from all
Run Code Online (Sandbox Code Playgroud)
在/etc/apache2/sites-enabled/000-default.conf中我添加:
<Directory /usr/share/phppgadmin/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Run Code Online (Sandbox Code Playgroud)
我尝试更改/ usr/share/phppgadmin /,/ var/www的权限...
即使我卸载了包phpgpadmin,我也有同样的信息!
apt-get remove phppgadmin
Run Code Online (Sandbox Code Playgroud)
非常感谢帮助......
尝试在我的 Symfony 5.1 应用程序上将 Symfony 邮件程序与 Gmail 结合使用。
邮件程序.yaml:
framework:
mailer:
dsn: '%env(MAILER_DSN)%'
Run Code Online (Sandbox Code Playgroud)
.env:
MAILER_DSN=gmail+smtp://myadresse@gmail.com:mypassword@localhost
Run Code Online (Sandbox Code Playgroud)
但每次我发送邮件时,我都会收到:
Connection could not be established with host "ssl://smtp.gmail.com:465": stream_socket_client():
SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
Run Code Online (Sandbox Code Playgroud)
不明白为什么......根据https://symfony.com/doc/current/mailer.html它应该可以工作。
我在 Gmail 帐户上激活了低安全性应用程序。
感谢帮助
我在我的表"Artiste"中有一列"valideAdmin",其值为1或0.
我尝试做一个简单的计数来返回表中"valideAdmin"为1的条目数:
$repo = $this ->getDoctrine()
->getManager()
->getRepository('ProjectMainBundle:Artiste');
$qb = $repo->createQueryBuilder('valideAdmin');
$qb->select('COUNT(valideAdmin)');
$qb->where('valideAdmin=1');
$count = $qb->getQuery()->getSingleScalarResult();
return array(
'count' => $count
);
Run Code Online (Sandbox Code Playgroud)
但总是"1"谁回来了......
如果没有where子句,我有表的条目总数,但是valideAdmin可以是0或1.我只想要valideAdmin = 1的计数
感谢帮助
我尝试在我的wampserver上安装postgreSql
所以我按照一些教程和其他一些...
但是当我访问时localhost/phppgadmin/,会发生错误:
Forbidden
You don't have permission to access /phppgadmin/ on this server.
Run Code Online (Sandbox Code Playgroud)
虽然我在PHP扩展中激活php_pgsql和php_pdo_pgsql ...
我的phppgadmin.conf:
# File phppgadmin.conf
Alias /phppgadmin "C:/wamp/apps/phppgadmin5.1/"
<Directory "C:/wamp/apps/phppgadmin5.1/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Allow from all
</Directory>
Run Code Online (Sandbox Code Playgroud)
感谢帮助 !
我最近将我的Silex v1.3项目迁移到了Silex v2,其中一切正常.我得到一个枝条错误,我不明白原因
Twig_Error_Runtime in Template.php line 590:
Neither the property "request" nor one of the methods "request()", "getrequest()"/"isrequest()" or "__call()" exist and have public access in class "Silex\Application" in "index.twig" at line 5
Run Code Online (Sandbox Code Playgroud)
这是我的index.twig文件的第5行
{% extends "layout.twig" %}
{% block stylsheets %}
<link rel="stylesheet" type="text/css" href="{{ app.request.basepath }}/public/libs/odometer/themes/odometer-theme-minimal.css" />
Run Code Online (Sandbox Code Playgroud)
当然在布局中,我称之为
{% block stylsheets %}{% endblock %}
Run Code Online (Sandbox Code Playgroud)
但我完全不确定,问题出现在twig文件上......是否有必要改变?
这是控制器的摘录:
$app->get('/', function () use ($app) {
return $app['twig']->render('index.twig', [
...
]);
})->bind('homepage');
Run Code Online (Sandbox Code Playgroud)
感谢帮助
我的控制器是基本的
$app->get('/files/{type}', function ($type) use ($app) {
$path = __DIR__ . "/../files/$type";
if (!file_exists($path)) {
$app->abort(404, "Ce fichier n'existe pas.");
}
return $app
->sendFile($path)
;
})->bind('getfile');
Run Code Online (Sandbox Code Playgroud)
根据这个文档它是有效的.当我调用正确的URL时,该文件在当前窗口中打开.
但是我不想在浏览器中打开文件,我想打开对话框来保存文件.
我怎样才能做到这一点 ?
我有一个调用getJSON的函数.但是当再次调用函数时,getJSON调用通常不会完成.
所以我想在发送新的之前停止先前的getJSON运行.
我尝试在全局变量中保存我的getJSON调用,并在函数的开头调用abort(),但是我得到了一个错误
TypeError: vr is undefined
Run Code Online (Sandbox Code Playgroud)
这是我的功能
var vr;
function getVol() {
vr.abort();
var data = {
form : fields
};
vr = $.getJSON('getVol.php', data).done(function(r) {
$.each( r, function( key, item ) {
$.each( item, function( key, value ) {
if(parseInt(value) > maxValue) maxValue = parseInt(value);
});
});
}).fail(function() {
console.log( "error" );
});
}
Run Code Online (Sandbox Code Playgroud)
感谢帮助
我尝试在我的PostgreSQL数据表中执行一个简单的创建表,通过执行下面的createTables函数:
public function createTables() {
try {
$db = new PDO('pgsql:host='.$this->PARAM_hote.';port='.$this->PARAM_port.';dbname='.$this->PARAM_nom_bd.';user='.$this->PARAM_utilisateur.';password='.$this->PARAM_mot_passe);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sql ='CREATE TABLE IF NOT EXISTS test (id INT(11) AUTO_INCREMENT PRIMARY KEY, prename VARCHAR(50) NOT NULL);';
$db->exec($sql);
} catch(PDOException $e) {
echo $e->getMessage();
}
}
Run Code Online (Sandbox Code Playgroud)
但我仍然有:
testSQLSTATE[42601]: Syntax error: 7 ERREUR: erreur de syntaxe sur ou près de « ( » LINE 1: CREATE TABLE IF NOT EXISTS test (id INT(11) AUTO_INCREMENT P... ^
Run Code Online (Sandbox Code Playgroud)
我不知道为什么?...
感谢帮助
我在PostgreSQL插入请求中有一些想法是不正确的.当我执行:
INSERT INTO data
( Email ,
Email_MD5 ,
Date_In ,
Tel_mobile ,
Tel_fixe ,
Gender ,
Title ,
FirstName ,
LastName ,
DateOfBirth ,
YearOfBirth ,
AgeGroupe ,
Adresse_1 ,
Adresse_2 ,
CP ,
Ville ,
Domain ,
Groupe_Domaine ,
Last_Date_R ,
Last_Date_O ,
Last_Date_C ,
Pression ,
Activity ,
R
)
VALUES ( "000090@voila.fr" ,
"b6ffc0c54f2c35866c4ccc4a7218472c" ,
NULL ,
"" ,
"5789332" ,
"MLLE" ,
"" ,
"Lydia" ,
"Le Port" ,
NULL ,
NULL ,
"26 - …Run Code Online (Sandbox Code Playgroud) 我使用 Symfony 表单生成器来生成重复类型 (RepeatedType) 的密码字段 (PasswordType):
->add('plainPassword', RepeatedType::class, [
'type' => PasswordType::class,
'required' => true,
'first_options' => array('label' => 'Password'),
'second_options' => array('label' => 'Repeat Password'),
'constraints' => [
new Assert\NotBlank(['message' => "Ce champ est obligatoire."]),
new Assert\Length([
'min' => 8,
'minMessage' => 'Le mot de passe doit comporter plus de {{ limit }} caractères.',
]),
],
'invalid_message' => 'Le mot de passe doit être identique.',
'options' => ['attr' => [
'class' => 'password-field',
'placeholder' => "Mot de passe"
]], …Run Code Online (Sandbox Code Playgroud)