在一种语言中(因为我现在正在使用它)PHP,它支持程序和面向对象的范例.
确定哪种范例最适合新项目是否有一个很好的经验法则?如果没有,你怎么能做出决定?
我的文件上传时出现此问题.我尝试上传我的PDF文件,同时检查验证是否TMP_NAME为空,当我检查$_FILES['document_attach']['error']值为1时,这意味着有一个错误.
但是当我尝试上传其他PDF文件时,它已成功上传.为什么其他PDF文件没有?
HTML
<form action="actions/upload_internal_audit.php" method="post" enctype="multipart/form-data">
<label>Title</label>
<span><input type="text" name="title" class="form-control" placeholder="Document Title"></span>
<label>File</label>
<span><input type="file" name="document_attach"></span><br>
<span><input type="submit" name="submit" value="Upload" class="btn btn-primary"></span>
</form>
Run Code Online (Sandbox Code Playgroud)
PHP
if(isset($_POST['submit'])){
$title = $_POST['title'];
$filename = $_FILES['document_attach']['name'];
$target_dir = "../eqms_files/";
$maxSize = 5000000;
if(!empty($title)){
if(is_uploaded_file($_FILES['document_attach']['tmp_name'])){
if ($_FILES['document_attach']['size'] > $maxSize) {
echo "File must be: ' . $maxSize . '";
} else {
$result = move_uploaded_file($_FILES['document_attach']['tmp_name'], $target_dir . $filename);
mysqli_query($con, "INSERT into internal_audit (id, title, file) VALUES ('', '".$title."', '".$filename."')");
echo …Run Code Online (Sandbox Code Playgroud) 我在XAMPP中部署了我的源代码.我遇到了以下错误.
注意:在第257行的C:\ xampp\htdocs\3c_app\public_html\system\core\Common.php中只能通过引用返回变量引用
致命错误:在C:\ xampp\htdocs\3c_app中找不到类'CI_Controller'第233行的\ public_html\system\core\CodeIgniter.php.
我的源文件是:
的common.php
// Are any values being dynamically replaced?
if (count($replace) > 0)
{
foreach ($replace as $key => $val)
{
if (isset($config[$key]))
{
$config[$key] = $val;
}
}
}
return $_config[0] =& $config;
}
Run Code Online (Sandbox Code Playgroud)
第257行是: return $_config[0] =& $config;和
Codeigniter.php
// Fetch the config file
if ( ! file_exists($file_path))
{
exit('The configuration file does not exist.');
}
require($file_path);
Run Code Online (Sandbox Code Playgroud)
第233行: if ( ! file_exists($file_path))
任何人都可以帮忙???
我想要像www.sample.com/controller这样的普通 URL而不是 www.sample.com/public/index.php/controller。
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ public/index.php/$1 [L]
Run Code Online (Sandbox Code Playgroud)
我的 .htaccess 文件
我使用CodeIgniter 3作为Web平台,并尝试将语义UI UI导入到我的页面中.我是通过base_url()在CSS导入的href属性中使用CodeIgniter的方法来实现的.
但是,semantic.css本身会导入我服务器上存在的其他一些字体,然后由于跨源资源共享策略而无法加载这些字体.这是chrome给我的错误消息:
来自"来源" http://[::1]的字体已被阻止通过跨源资源共享策略加载:请求的资源上不存在"Access-Control-Allow-Origin"标头.原产地" :HTTP //本地主机,因此"是不允许访问.
这是因为[::1]我输入浏览器时,base_url()回应域已经存在而不是localhost.
出于某种原因,在我看来,chrome(以及Edge)并不认为[::1]和localhost是同一个主机,或者我可能只是愚蠢.我所知道的是,如果我将主semantic.css文件的路径和硬代码localhost更改为它,它可以工作,如果不是使用localhost请求我的页面,它也可以使用[::1]
我已经完成了与此类似的其他项目,从未"[::1]"出现过这种情况.究竟是什么导致php回应这样的路径?
我有两个docker容器:Nginx和App.
app容器扩展了PHP-fpm并且还有我的Laravel代码.
在我的docker-compose.yml工作中:
version: '2'
services:
nginx:
build:
context: ./nginx
dockerfile: ./Dockerfile
ports:
- "80:80"
links:
- app
app:
build:
context: ./app
dockerfile: ./Dockerfile
Run Code Online (Sandbox Code Playgroud)
在我的Nginx Dockerfile中,我正在做:
FROM nginx:latest
WORKDIR /var/www
ADD ./nginx.conf /etc/nginx/conf.d/default.conf
ADD . /var/www
EXPOSE 80
Run Code Online (Sandbox Code Playgroud)
在我的App Dockerfile中,我正在做:
FROM php:7-fpm
WORKDIR /var/www
RUN apt-get update && apt-get install -y libmcrypt-dev mysql-client && docker-php-ext-install mcrypt pdo_mysql
ADD . /var/www
Run Code Online (Sandbox Code Playgroud)
在成功运行docker-compose之后,当我尝试localhost时出现以下错误
无法打开流或文件"/var/www/storage/logs/laravel.log":无法打开流:权限被拒绝
根据我的理解,存储文件夹需要由Web服务器写入.
我应该怎么做才能解决这个问题?
我在Windows 8上安装了wamp.
得到错误:
警告:mail()[function.mail]:无法连接到"localhost"端口25的邮件服务器,验证php.ini中的"SMTP"和"smtp_port"设置,或者在C:\ wamp\www \中使用ini_set()第9行的mail.php
这是简单的源代码:
<?php
// The message
$message = "Line 1\r\nLine 2\r\nLine 3";
// In case any of our lines are larger than 70 characters, we should use wordwrap()
$message = wordwrap($message, 70, "\r\n");
// Send
mail('caffeinated@example.com', 'My Subject', $message);
?>
Run Code Online (Sandbox Code Playgroud)
我需要在Windows 8上通过php安装哪些软件才能发送电子邮件?sendmail,msmtp或ssmtp?
我可以在哪里放置我的"全局"功能,如果用户已登录,它将检查?
因为我想做类似的事情:用户只有在函数isLogged()返回TRUE 时才能浏览某些页面,并且我必须在某些视图中使用它,这就是为什么它应该是一个"全局"函数,我可以从任何地方.
那可能吗?或者有更好的解决方案吗?
我们使用Jira Agile和"Daily Scrum"板来过滤最后一天到期的问题.这将向我们展示我们昨天应该解决的问题以及我们今天要解决的问题.除星期一外,这很好用.
星期一,我们希望看到截止日期或今天截止日期的问题.如何使用JQL实现这一目标?看来JQL不支持IF(),对吗?
如果是这样,我们可能会找到使用比较的方法now() == startOfWeek().
我没有找到关于交叉路径的用途和目的的良好文档.有人可以指出我的文档或回答这些具体问题.
scala'和' scala-2.11'.难道不应该只有这两个中的一个吗?这两个文件夹的含义是什么?scala'和什么进入' scala-2.11'?