草庐IT

byte-compiling

全部标签

php - 命令 "clear-compiled"未定义。拉维尔 5.2

我正在尝试使用Composer下载LaravelHTML依赖项。composer.json在这里:"name":"laravel/laravel","description":"TheLaravelFramework.","keywords":["framework","laravel"],"license":"MIT","type":"project","require":{"php":">=5.5.9","laravel/framework":"5.2.*","illuminate/html":"5.2"},当我运行composerupdate或phpcomposerupdate时

php - 错误 : Allowed memory size of 67108864 bytes exhausted

当我上传图片时文件大小:375kb宽度:2000px高度:3000px我得到一个错误ERRORFatalerror:Allowedmemorysizeof67108864bytesexhausted(triedtoallocate2157bytes)in...当67108864=64MB时,为什么会发生这种情况?我使用共享服务器。我的.htaccess是:RewriteEngineonRewriteRule^$webroot/[L]RewriteRule(.*)webroot/$1[L]我必须在哪里写php_valuememory_limit128M? 最佳

php - bin2hex(random_bytes()) 根据输入有多少个字符?

我正在使用以下代码为我的应用生成一个简单的UID:privatefunction_createUid(){$bytes=random_bytes(128);$uid=bin2hex($bytes);return$uid;}通过这样做,_createUid()的结果将是一个256个字符的字符串。我的问题是,如果在同一台服务器上运行,此字符串是否始终为256字符,我知道不同服务器上存在一些差异。还有,一个字节等于两个字符吗?任何帮助都会很棒,谢谢! 最佳答案 在十六进制中,一个字节总是表示为2个字符。字节的十六进制表示是两个字符对的序列

php - artisan clear-compiled 返回错误代码 255

在我的laravel项目上运行composerinstall时出现错误:Scriptphpartisanclear-compiledhandlingthepost-install-cmdeventreturnedwitherrorcode255关于可能是什么问题的任何建议?注意Composer安装所有供应商包。完整输出如下:[user@some_path]$composerupdateLoadingcomposerrepositorieswithpackageinformationUpdatingdependencies(includingrequire-dev)Nothingtoin

AttributeError: ‘bytes‘ object has no attribute ‘encode‘异常解决方案

AttributeError: 'bytes'objecthasnoattribute'encode'是:“字节”对象没有属性的编码的意思。很明显,是编码格式的问题,例如:已经是byte格式的字符串类型,二次进行encode的时候就会出现这个bug,示例如下:str_info='HelloWorld!'print(str_info)#byte字符串-utf-8str_info=str_info.encode("utf-8")print(str_info)#byte字符串-GBKstr_info=str_info.encode("gbk")print(str_info)异常的报错效果如下:其实异

Phoenix开始投掷(UndefinedFunctionError)功能:crypto.rand_bytes/1是不确定的或私有的

之后并更新到我的系统-Mac,我的Phoenix应用程序编译正常,但是只要我碰到任何路线,就会丢弃此错误。服务器:LocalHost:4000(HTTP)请求:GET/**(退出)升高了一个例外:**(UndefinedFunctionError)函数:crypto.rand_bytes/1不确定或私有。您的意思是:*rand_seed/0*rand_seed/1(crypto):crypto.rand_bytes(20)(plug)lib/plug/request_id.ex:59:Plug.RequestId.generate_request_id/0(plug)lib/plug/requ

PHP 警告 : POST Content-Length of n bytes exceeds the limit of 3145728 bytes in Unknown on line 0

我很惊讶地在我的错误日志中发现上述错误,因为我认为我已经完成了必要的工作来捕获我的PHP脚本中的错误:if($_FILES['image']['error']==0){//goaheadtoprocesstheimagefile}else{//determinetheerrorswitch($_FILES['image']['error']){case"1":$msg="Uploadedfileexceedstheupload_max_filesizedirectiveinphp.ini.";break;....}}在我的PHP.ini脚本中,相关的设置是:memory_limit=1

php - openssl_random_pseudo_bytes() 很慢 (PHP)

我在PHP中使用opennssl_random_pseudo_bytes(),它的执行速度非常慢。我的应用程序经常超时(抛出执行时间限制错误)。OpenSSLrandom这么慢有什么特别的原因吗?我目前在我的开发人员机器上使用Windows7x86。 最佳答案 在Windows上,openssl_random_pseudo_bytes()调用OpenSSL的RAND_screen()来生成熵。它非常慢,而且PHP几乎不是第一个遇到这种情况的unix->windows端口。看起来常见的建议是改用RAND_seed()。另外值得注意的是

php - 有效模式的 PHP 中的 "preg_match(): Compilation failed: unmatched parentheses"

想知道是否有人可以阐明为什么在PHP的preg_match函数中使用以下正则表达式会失败:-这会导致错误消息“preg_match():编译失败:括号不匹配”,尽管该模式似乎是有效的。我用在线测试了它PHPRegularExpressiontester和Linux工具Kiki。似乎PHP正在转义左括号而不是反斜杠。我通过使用str_replace将反斜杠换成正斜杠来解决这个问题。这适用于我的情况,但很高兴知道为什么这个正则表达式失败。 最佳答案 要对文字反斜杠进行编码,您需要将其转义两次:一次用于字符串,一次用于正则表达式引擎:pr

php - 我应该使用 urandom 还是 openssl_random_pseudo_bytes?

我正在用php5.4开发一个站点,我想知道使用哪个来生成随机盐以确保密码安全性更好?$salt=sha1(openssl_random_pseudo_bytes(23));或$seed='';$a=@fopen('/dev/urandom','rb');$seed.=@fread($a,23);$salt=sha1(seed);或者我应该选择:$salt=openssl_random_pseudo_bytes(40);或$salt='';$a=@fopen('/dev/urandom','rb');$salt.=@fread($a,23); 最佳答案