问题标签 [php-7.1]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
php - AJAX 请求中的“遇到非数字值”。为什么没有捕获值?
使用 AJAX 将表单信息发送到 php 处理页面。执行 var_dump 显示值以“0”的形式出现,即使输入的数字不是。即使这些值被指定为“(int)”,PHP7 也会返回“在 /process_measurements.php 第 20 行遇到的非数字值”。
如果我按如下方式显式地对它们进行类型转换,那么 PHP 错误就会消失,但是,var_dump 显示它们以 0 的形式出现......而不是输入到表单中的值,因此无论在表单中输入的值如何,计算结果都是 0。
代码显示“遇到非数字值”错误:
rest - Magento 2 Rest api创建订单不添加送货地址
我正在尝试使用 magento 2 rest api 创建订单。但送货地址未添加订单详细信息。由于没有送货地址,订单格式不完整
这是 json 请求:
{"实体":{"base_currency_code":"INR","base_discount_amount":0,"base_grand_total":38,"base_shipping_amount":5,"base_shipping_incl_tax":5,"base_shipping_tax_amount":0,"base_shipping_discount_amount":0, "base_subtotal":33,"base_subtotal_incl_tax":33,"base_total_due":38,"base_to_global_rate":1,"base_to_order_rate":1,"discount_tax_compensation_amount":0,"base_discount_tax_compensation_amount":0,"shipping_discount_tax_compensation_amount":0,"customer_is_guest ":0,"customer_dob":"1987 年 1 月 18 日","customer_email":"sharvesh@gmail.com","customer_firstname":"Sharvesh","customer_gender":1,"customer_group_id":1,"customer_id":4,"customer_lastname":"CP","customer_note_notify":1,"discount_amount":0,"email_sent":1,"global_currency_code":"INR","grand_total":38 ,"order_currency_code":"INR","remote_ip":"127.0.0.1","shipping_amount":5,"shipping_tax_amount":0,"shipping_description":"统一费率 - 固定","shipping_discount_amount":0,"shipping_incl_tax ":5,"state":"pending","status":"pending","store_currency_code":"INR","store_to_base_rate":0,"store_to_order_rate":0,"store_id":1,"subtotal": 33,"subtotal_incl_tax":33,"total_due":38,"total_item_count":1,"total_qty_ordered":1,"tax_amount":0,"weight":1,"items":[{"base_original_price":33,"base_price":33,"base_price_incl_tax":33,"base_row_total" :33,"base_row_total_incl_tax":33,"name":"Endeavor Daytrip Backpack","original_price":33,"price":33,"price_incl_tax":33,"product_id":11,"product_type":"simple" ,"qty_ordered":1,"row_total":33,"row_total_incl_tax":33,"sku":"24-WB06","store_id":1,"weight":1}],"billing_address":{"address_type ":"billing","city":"Chennai","company":"Netmeds","country_id":"IN","customer_address_id":4,"email":"sharvesh@gmail.com","firstname":"Sharvesh","lastname":"C","postcode":"600117","region":"Tamilnadu"," street":["6A,4th street,Keelkattalai"],"telephone":"9840626148"},"payment":{"amount_ordered":38,"base_amount_ordered":38,"base_shipping_amount":5,"method": "checkmo","shipping_amount":5},"status_histories":[],"extension_attributes":{"shipping_assignments":[{"shipping":{"address":{"address_type":"shipping","city" :"Chennai","company":"Netmeds","country_id":"IN","customer_address_id":4,"email":"sharvesh@gmail.com","firstname":"Sharvesh","lastname":"C","postcode":"600117","region":"Tamilnadu"," street":["6A,4th street,Keelkattalai"],"telephone":"9840626148"},"method":"flatrate_flatrate","total":{"base_shipping_amount":5,"base_shipping_incl_tax":5,"shipping_amount ":5,"shipping_incl_tax":5},"extension_attributes":[]},"items":[{"base_original_price":33,"base_price":33,"base_price_incl_tax":33,"base_row_total":33," name":"奋进一日游背包","original_price":33,"price":33,"price_incl_tax":33,"product_id":11,"product_type":"simple","qty_ordered":1,"row_total":33,"row_total_incl_tax":33,"sku":"24-WB06","store_id" :1,"weight":1}],"extension_attributes":[]}],"applied_taxes":[],"item_applied_taxes":[],"converting_from_quote":true}}}
告诉我是否缺少任何东西或者我需要添加任何东西。
php - 如何使 openssl_encrypt 将输入填充到所需的块大小?
如果我手动将字符串填充到 32 的长度,我的代码就可以工作。
我的问题是:有没有办法让 openSSL 填充数据,还是我总是必须这样做?
在职的:
不工作:
我目前通过自我填充解决了这个问题:
php-7.1 - Debian Wheezy 和 PHP 7.1 安装
我在 Debian wheezy 上有 ISPConfig 3.1 和 php 5.4 和 php 5.3。我正在尝试根据本手册为 Debian Jessie 在同一台服务器上安装 php 7.1: https ://www.howtoforge.com/tutorial/how-to-install-php-7-on-debian/ 当然它确实如此不行。在“make”步骤中,它说:“没有指定目标,也没有找到 makefile。停止。”
我还找到了这条指令: https ://www.cyberciti.biz/faq/installing-php-7-on-debian-linux-8-jessie-wheezy-using-apt-get/ ,但是我不能使用它,因为我我的服务器上也需要 php5.4 和 PHP 5.3。
可行吗?
php-7.1 - 局部变量保持未初始化
私有数组$list_of_files
保持未初始化。如何从 while 循环中更新它?
php - 将 Plesk 的 PHP 版本更改为 PHP 7
我在 Debian 3.16.39-1 (2016-12-30) x86_64 GNU/Linux 上运行 Plesk 版本 17.0.17 更新 #16
我的问题是我不知道如何通过 Plesk 将全局 PHP 版本更新到 7.1
我需要这样做,因为我尝试使用 Composer 安装的包需要它。
我无法删除它,因为它说“ Plesk 正在使用旧版本运行”并且我似乎无法更改 Plesk 使用的版本。我只能为个别网站设置它,而且我对运行多个 PHP 版本不感兴趣。
我已经安装了新版本,并且可以在创建如下符号链接时运行它:
ln -s /opt/plesk/php/7.1/bin/php /usr/bin/php
当我这样做时,一切正常,并且仅当 Plesk 更新它并覆盖导致我不得不再次执行此操作的路径时才会出现问题。
我不能只通过 Plesk 删除旧版本,因为它说它与 Plesk 本身冲突,因为它使用它来运行。
概括:
我希望 Plesk 运行 PHP 7.1 版并完全删除旧版本。我怎样才能做到这一点?
php - Openssl 相当于 mcrypt_get_block_size
我目前正在用 OpenSSL 替换 Mcrypt,因为 Mcrypt 将在 PHP 7.1 中被弃用。我需要一种方法来获取每个算法的块大小,例如mcrypt_get_block_size()
.
我想知道是否有等效的功能,mcrypt_get_block_size()
但它的记录非常糟糕,似乎找不到它。
php - require_once 在 PHP 5.6 中有效,但在 PHP 7 中无效
我的代码中有以下行,它在 PHP-5.6 中运行良好,但在 PHP-7.1 中运行良好。
当我将其更改为以下之一时,它是否适用于 PHP-7.1?
或者
第一行代码有什么问题?
php - PHP 7 curl 未加载
我已经在我的本地计算机上安装了 apache 2.4 和 PHP 7.1。我在我的 php.ini (extension=php_curl.dll) 中启用了 curl,但由于某种原因,即使在启用它之后 curl 也没有被加载,我做了一个 phhinfo 来检查,什么也没有,我还做了一个小脚本:
什么都没有,是空白的,这意味着没有被加载,是不是缺少了什么?我在 Windows 10 上。
php - PHP7.1安装失败时
我使用了命令-
在它返回 shell 之前收到这个作为最后一个输出。这是否意味着安装正常或需要更正某些内容?
谢谢