完全搞砸我在PHP上的PHP配置试图让SOAP模块工作(-bash:/ usr/bin/php:没有这样的文件或目录....)我现在必须使用MAMP但每次我必须键入路径
Applications/MAMP/bin/php5.3/bin/php to do command line.
Run Code Online (Sandbox Code Playgroud)
如何只输入php而不是MAC上的整个路径?我仔细检查过,我没有名为.profilenor 的文件bash_profile
谢谢
PS:这是什么输出echo $ PATH:
echo $PATH
/Applications/MAMP/Library/bin/:/Applications/MAMP/bin/php5/bin/:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin
Run Code Online (Sandbox Code Playgroud) 在页面上,我有:
if (!empty($_FILES['logo']['name'])) {
$dossier = 'upload/';
$fichier = basename($_FILES['logo']['name']);
$taille_maxi = 100000;
$taille = filesize($_FILES['logo']['tmp_name']);
$extensions = array('.png', '.jpg', '.jpeg');
$extension = strrchr($_FILES['logo']['name'], '.');
if(!in_array($extension, $extensions)) {
$erreur = 'ERROR you must upload the right type';
}
if($taille>$taille_maxi) {
$erreur = 'too heavy';
}
if(!empty($erreur)) {
// ...
}
}
Run Code Online (Sandbox Code Playgroud)
问题是,如果用户想要编辑信息而不上传LOGO,则会引发错误:'错误您必须上传正确的类型'
因此,如果用户没有在输入框中放置任何内容以便上传它,我不想在这些条件下输入测试.
我测试过:
if (!empty($_FILES['logo']['name'])和if (isset($_FILES['logo']['name'])
但两者似乎都不起作用.
有任何想法吗?
编辑:也许我不是那么清楚,我不想测试他是否上传了一个徽标,我想测试他选择了一个文件上传,因为现在,如果他没有选择要上传的文件, php引发错误,告诉他必须以正确的格式上传.
谢谢.
我正在构建一个图表,我希望每个月都能收到数据.
这是我的第一个请求:
SELECT s.GSP_nom AS nom, timestamp, AVG( v.vote + v.prix ) /2 AS avg
FROM votes_serveur AS v
INNER JOIN serveur AS s ON v.idServ = s.idServ
WHERE s.valide =1
AND v.date > CURDATE() -30
GROUP BY s.GSP_nom
ORDER BY avg DESC
Run Code Online (Sandbox Code Playgroud)
但是,在我的情况下,我要编写12个请求来接收前12个月的数据,是否有任何技巧可以避免编写:
// example for the previous month
AND v.date > CURDATE() -60
AND v.date < CURDATE () -30
Run Code Online (Sandbox Code Playgroud)
我听说过INTERVAL,我去了MySQL文档,但我没有设法实现它.
有任何使用INTERVAL的例子吗?
我想强调jquery datepicker上的日期,其中有附加事件(我不是在谈论js事件,而是现实生活事件:D).
是否有可用的插件或资源(如教程)来帮助我实现这一目标?
谢谢.
PS:我没有使用datepicker来选择日期,只是为了访问附加到日期的事件
PS2:我将在多语言网站(fr和英语)上使用它,这就是为什么我想到了datepicker
jquery jquery-ui datepicker jquery-plugins jquery-ui-datepicker
查看我的prod日志后,我提到了一些错误:
[2012-08-31 15:56:43] request.CRITICAL: Doctrine\DBAL\DBALException:
An exception occurred while executing 'SELECT t0.username ....... FROM fos_user t0 WHERE t0.username = ?'
with params {"1":"Nrv\u29e7Kasi"}:
SQLSTATE[HY000]: General error: 1267 Illegal mix of collations (latin1_swedish_ci,IMPLICIT)
and (utf8_general_ci,COERCIBLE) for operation '='
Run Code Online (Sandbox Code Playgroud)
Alghout我在学说cfg下有UTF-8默认值:
doctrine:
dbal:
charset: UTF8
Run Code Online (Sandbox Code Playgroud)
好像我的所有MySQL表都在latin1_swedish_ci,所以我的问题是:
我是否可以手动更改utf8_general_ci所有表格的校对而无需任何复杂/预防措施?
我想使用一个名为Symfony的框架开发,但我没有Mac,我不想用Debian进行双启动.
我通过Virtual Box尝试了虚拟主机,但它不起作用.所以我决定留在Windows上.
所以当教程告诉我这样做时
php lib/vendor/symfony/data/bin/check_configuration.php
Run Code Online (Sandbox Code Playgroud)
我在windows cmd中做:
php lib\vendor\symfony\data\bin\check_configuration.php
Run Code Online (Sandbox Code Playgroud)
它告诉我:
'php'不被识别为内部或外部命令
我使用存储的UwAmp(php 5.2.12 + mysql + apache)
E:\logiciels\UwAmp\
Run Code Online (Sandbox Code Playgroud)
我有一堆文件,但我想这很重要:
E:\logiciels\UwAmp\apache\php_5.2.11
Run Code Online (Sandbox Code Playgroud)
如何使Windows cmd中的cmd PHP正常工作?
我想知道,我有这个HTML:
<li>
<span class="jqTransformRadioWrapper">
<a rel="choices[choices]" class="jqTransformRadio jqTransformChecked" href = "#"></a>
<input type="radio" id="choices_choices_5" value="5" name="choices[choices]" class="jqTransformHidden">
</span>
<label for = "choices_choices_5" style = "cursor: pointer;">My awesome test</label>
</li>
Run Code Online (Sandbox Code Playgroud)
有些人可能会认识到输入是jqTransformed
我想知道如何点击名为"我很棒的测试"的标签.
现在,我这样做:
$el = $this->getSession()->getPage()->find('css', 'ul li span.jqTransformRadioWrapper a');
$el->click();
Run Code Online (Sandbox Code Playgroud)
但它选择了第一个元素.我想用他们的名字(并且只有)选择它们,对于这个例子,它将是"我真棒的测试".
谢谢
我正处于环境设置中,运行OSX MariaDB 10.0.12-MariaDB Homebrew
我搞砸了安装,所以我从我的设置中完全删除了MySQL和MariaDB,然后重新开始.
完成MariaDB的安装后,我innoDB通过生产服务器上的DB Dump 重新导入了我的数据库().它工作正常.重新启动后,第二天,我无法再访问数据库:
Table 'my.table' doesn't exist in engine
造成这种情况的原因是什么?解决方案是什么?我确实看到了我的数据库的结构,但是当我尝试访问它时,它给了我这个错误信息.
我确实尝试mysql-upgrade --force删除了rm ib_logfile1 ib_logfile0
这里的数据丢失不是问题,问题是我每次重启时都不能花30分钟重新安装每个数据库.
这是一些日志:
140730 9:24:13 [Note] Server socket created on IP: '127.0.0.1'.
140730 9:24:14 [Note] Event Scheduler: Loaded 0 events
140730 9:24:14 [Warning] InnoDB: Cannot open table mysql/gtid_slave_pos from the internal data dictionary of InnoDB though the .frm file for the table exists. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html for how you can resolve the problem.
140730 9:24:14 [Warning] Failed to …Run Code Online (Sandbox Code Playgroud) 我有 :
$date = $actualite['date'];
Run Code Online (Sandbox Code Playgroud)
$actualite['date'] 是TIMESTAMP
我想知道如何从这个时间戳中提取当天,然后是月份,然后是3个变量中的年份.
谢谢您的帮助 :)
我想将布尔值传递给我 DogForm
$dogForm = new DogForm(null, array("has_cats" => $this->getUser()->hasCats()));
$form = $this->createForm($dogForm, $dog);
Run Code Online (Sandbox Code Playgroud)
但在我做的时候DogForm:
if (!isset($options['has_cats'])) {
throw new \Exception("Missing option has_cats, this option is mandatory");
}
Run Code Online (Sandbox Code Playgroud)
它总是给我这个错误.
所以我知道狗不应该有猫但是,我的has_cats选择去了哪里?
谢谢.