我尝试将kohana 3项目设置为虚拟主机.
配置:
<VirtualHost *:80>
DocumentRoot "D:/Devel/matysart/matysart_dev1"
ServerName matysart-one.local
ServerAlias www.matysart-one.local
DirectoryIndex index.php
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
错误(403):
[client 127.0.0.1]客户端被服务器配置拒绝:D:/ Devel/matysart/matysart_dev1 /
有人可以帮忙吗?
我在视图中使用Django进行用户登录:
url(r'^user/login/$', 'django.contrib.auth.views.login', {'template_name': 'users/templates/login.html'}, name='user-login'),
Run Code Online (Sandbox Code Playgroud)
登录后,当我再次转到用户/登录时,我可以第二次登录.我提交表格并获得:
当前网址(accounts/profile /)与其中任何一个都不匹配.
我还没有申报这个网址urls.py.
我做错了什么?为什么框架要重定向到此URL?
我尝试做斑马条纹:
{% set counter = 0 %}
{% for entity in entities %}
<tr class="{{ cycle(['odd', 'even'], counter) }}">
{% counter++ %}
Run Code Online (Sandbox Code Playgroud)
但我收到错误:
意外的标签名称"counter"(期望在第11行附近定义的"for"标签的结束标签)
有人可以给我解决方案吗?
[编辑]
我的糟糕解决方案很简单:
{% set counter = counter + 1 %}
Run Code Online (Sandbox Code Playgroud) 我的查询:
UDPATE message_recipients SET
recipient_status = 2 WHERE mid = 3 AND
recipient_id = 4
Run Code Online (Sandbox Code Playgroud)
表字段:
id,mid,recipient_status,recipient_id
错误:
1064 - 您的SQL语法出错; 查看与您的MySQL服务器版本对应的手册,以便在'UDPATE message_recipients SET recipient_status = 2 WHERE mid = 3 AND recipient_i'附近使用正确的语法
有人可以给我任何建议吗?
我正在使用PHPStorm 8.0.2
添加服务器:
工具>任务和上下文>配置服务器.
基于https://asana.com/developers/documentation/getting-started/authentication#sts=API%20Keys.
总是得到403,有没有人试图从PHPStorm连接这个?
我需要限制LEFT JOIN结果,所以我必须使用子查询.有人可以给我建议如何用Doctrine 2做到这一点?
我现在拥有的是:
$qb = $this->_em->createQueryBuilder();
return $qb->add('select', 'c,j')
->add('from', 'JobeetBundle:Category c')
->leftJoin('c.jobs', 'j', 'WITH', 'j.category = c')
->add('where', 'j.expiresAt > ?1')
->add('orderBy','j.expiresAt DESC')
->setParameter(1, new \DateTime())
->getQuery()
->getResult();
Run Code Online (Sandbox Code Playgroud)
但我必须改变它,将每个类别的工作结果限制在10.
我需要在命令行上增加PHP的内存限制,以便我可以使用Composer.
输出 php -i | grep memory_limit
memory_limit => 256M => 256M
输出 php --ini
Configuration File (php.ini) Path: /usr/local/php5/lib
Loaded Configuration File: /usr/local/php5/lib/php.ini
Scan for additional .ini files in: /usr/local/php5/php.d
Additional .ini files parsed: /usr/local/php5/php.d/10-extension_dir.ini,
/usr/local/php5/php.d/20-extension-opcache.ini,
/usr/local/php5/php.d/40-openssl.ini,
/usr/local/php5/php.d/50-extension-apcu.ini,
/usr/local/php5/php.d/50-extension-curl.ini,
/usr/local/php5/php.d/50-extension-gmp.ini,
/usr/local/php5/php.d/50-extension-igbinary.ini,
/usr/local/php5/php.d/50-extension-imap.ini,
/usr/local/php5/php.d/50-extension-intl.ini,
/usr/local/php5/php.d/50-extension-mcrypt.ini,
/usr/local/php5/php.d/50-extension-memcache.ini,
/usr/local/php5/php.d/50-extension-memcached.ini,
/usr/local/php5/php.d/50-extension-mongo.ini,
/usr/local/php5/php.d/50-extension-mssql.ini,
/usr/local/php5/php.d/50-extension-oauth.ini,
/usr/local/php5/php.d/50-extension-pdo_dblib.ini,
/usr/local/php5/php.d/50-extension-pdo_pgsql.ini,
/usr/local/php5/php.d/50-extension-pgsql.ini,
/usr/local/php5/php.d/50-extension-propro.ini,
/usr/local/php5/php.d/50-extension-raphf.ini,
/usr/local/php5/php.d/50-extension-readline.ini,
/usr/local/php5/php.d/50-extension-redis.ini,
/usr/local/php5/php.d/50-extension-solr.ini,
/usr/local/php5/php.d/50-extension-ssh2.ini,
/usr/local/php5/php.d/50-extension-twig.ini,
/usr/local/php5/php.d/50-extension-uploadprogress.ini,
/usr/local/php5/php.d/50-extension-xdebug.ini,
/usr/local/php5/php.d/50-extension-xhprof.ini,
/usr/local/php5/php.d/50-extension-xsl.ini,
/usr/local/php5/php.d/60-extension-pecl_http.ini,
/usr/local/php5/php.d/99-liip-developer.ini
Run Code Online (Sandbox Code Playgroud)
所以我编辑/usr/local/php5/lib/php.ini但它总是256MB ......
重启Apache,但它是cli,但仍然没有成功.
我已成功安装phpunit:
sudo pear install --alldeps pear.phpunit.de/PHPUnit
Run Code Online (Sandbox Code Playgroud)
但是当我在控制台中提示phpunit时,我收到错误:
bash:/ usr/bin/phpunit:没有文件或目录
我有:
有人可以给我任何建议吗?
梨子清单给了我:
Installed packages, channel __uri:
==================================
(no packages installed)
Installed packages, channel components.ez.no:
=============================================
Package Version State
Base 1.8 stable
ConsoleTools 1.6.1 stable
Installed packages, channel doc.php.net:
========================================
(no packages installed)
Installed packages, channel pear.php.net:
=========================================
Package Version State
Archive_Tar 1.3.9 stable
Console_Getopt 1.3.1 stable
PEAR 1.9.4 stable
Structures_Graph 1.0.4 stable
XML_Util 1.2.1 stable
Installed packages, channel pear.phpunit.de:
============================================
Package Version State
File_Iterator 1.3.1 stable
PHPUnit 3.6.10 …Run Code Online (Sandbox Code Playgroud) 我的代码中的数组非常大,所以我将它粘贴在pastebin中.http://pastebin.com/6tviT2Xj
我不明白为什么我会得到无限循环
这个脚本的逻辑是:
$it = new ArrayIterator($options);
while($it->valid()) {
print $it->key();
print $it->current();
}
Run Code Online (Sandbox Code Playgroud) docker-compose.yml:
version: '3.3'
services:
web:
image: nginx:latest
ports:
- "8080:80"
volumes:
- ./api:/var/www/html/api
- ./site.conf:/etc/nginx/conf.d/default.conf
links:
- php
php:
build:
context: ./docker
dockerfile: php.Dockerfile
volumes:
- ./api:/var/www/html/api
links:
- db
db:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: symfony
MYSQL_USER: symfony
MYSQL_PASSWORD: symfony
ports:
- "9906:3306"
Run Code Online (Sandbox Code Playgroud)
php.Docker 文件:
FROM php:7-fpm
WORKDIR /var/www/html/api
COPY --from=composer /usr/bin/composer /usr/bin/composer
RUN apt-get update && apt-get upgrade -y \
&& apt-get install -y git libzip-dev unzip \
&& docker-php-ext-install \
pdo_mysql zip \
&& docker-php-ext-enable \ …Run Code Online (Sandbox Code Playgroud) php ×4
mysql ×2
apache ×1
asana ×1
composer-php ×1
django ×1
docker ×1
doctrine-orm ×1
kohana-3 ×1
left-join ×1
macos ×1
macos-sierra ×1
pear ×1
phpstorm ×1
phpunit ×1
sql ×1
sql-update ×1
symfony ×1
twig ×1
ubuntu ×1
virtualhost ×1