LoginSignup
0
0

More than 5 years have passed since last update.

XAMPPでPHPを使ってウェブスクレイピングするときの設定

Posted at

【php】webサイトから、欲しい情報を3行で取得する方法を真似してウェブスクレイピングをしようとしたが、failed to open stream: Invalid argument in~~とエラーが出た。
調べるとOpensslを有効化しないといけないというらしい。

XAMPPで仮想サーバーを立てていたので、XAMPPのファイルを編集しないといけない。
Cドライブ直下にxamppフォルダがあるはずなので、そのフォルダ内のphpフォルダにあるphp.iniを編集する。

php.ini
extension=php_openssl.dll

この一行を追加して、xamppを再起動後にウェブスクレイピングするとできるようになった。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0