投稿

9月, 2024の投稿を表示しています

Windows の PHP で https へ接続できない

Windows の PHP 8.3.11 で file_get_contents で https を取得しようとしたら下記のエラー PHP Warning:  file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? 対応 php.ini を編集 ※php.ini が無ければ、php.ini-development や php.ini-production をリネームして使う 以下の二箇所を探してコメント(;)を外す extension_dir = "ext" extension=openssl 上は extensions のディレクトリ指定 下は openssl の利用

Raspberry Pi の Python3 で ModuleNotFoundError: No module named 'Crypto'

Raspberry Pi OS の Python3 で 公式( https://document.candyhouse.co/demo/webapi-ja ) を参考に sesame 制御のコードを書いていたら from Crypto.Hash import CMAC from Crypto.Cipher import AES の箇所で ModuleNotFoundError: No module named 'Crypto' のエラー Crypt は Cryptodome に変更されているらしく from Cryptodome.Hash import CMAC from Cryptodome.Cipher import AES で無事作動 Cryptodome が見つからないなら下記でインストール # apt install python3-pycryptodome 参考文献 https://stackoverflow.com/questions/51824628/modulenotfounderror-no-module-named-crypto-error