Код: Выделить всё
// SCRAPER:
require_once 'simple_html_dom.php';
// Report all PHP errors (see changelog)
error_reporting(E_ALL);
// page to scrape
$base = 'https://kat.cr/applications/?rss=1';
// set up curl
$curl = curl_init();
// the url to request
curl_setopt( $curl, CURLOPT_URL, $base );
// return to variable
curl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );
// don't verify peer ssl cert
curl_setopt( $curl, CURLOPT_SSL_VERIFYPEER, false );
// // fetch remote contents, check for errors
if ( false === ( $response = curl_exec( $curl ) ) )
$error = curl_error( $curl );
// close the resource
curl_close( $curl );
if ( !$response ){
die("Curl Error: {$error}");
}
$html = new simple_html_dom();
$html->load($response);
$titre = $html->find('title', 2);
echo "Success... Title is: ".$titre."";
Код: Выделить всё
[root@nsxxxxx ~]# php -i|grep ssl
Configure Command => './configure' '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--target=x86_64-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib64' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--without-pear' '--with-bz2' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-xpm-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--with-kerberos' '--enable-ucd-snmp-hack' '--enable-shmop' '--enable-calendar' '--without-sqlite' '--with-libxml-dir=/usr' '--enable-xml' '--with-system-tzdata' '--enable-force-cgi-redirect' '--enable-pcntl' '--with-imap=shared' '--with-imap-ssl' '--enable-mbstring=shared' '--enable-mbregex' '--with-gd=shared' '--enable-bcmath=shared' '--enable-dba=shared' '--with-db4=/usr' '--with-xmlrpc=shared' '--with-ldap=shared' '--with-ldap-sasl' '--with-mysql=shared,/usr' '--with-mysqli=shared,/usr/lib64/mysql/mysql_config' '--enable-dom=shared' '--with-pgsql=shared' '--enable-wddx=shared' '--with-snmp=shared,/usr' '--enable-soap=shared' '--with-xsl=shared,/usr' '--enable-xmlreader=shared' '--enable-xmlwriter=shared' '--with-curl=shared,/usr' '--enable-fastcgi' '--enable-pdo=shared' '--with-pdo-odbc=shared,unixODBC,/usr' '--with-pdo-mysql=shared,/usr/lib64/mysql/mysql_config' '--with-pdo-pgsql=shared,/usr' '--with-pdo-sqlite=shared,/usr' '--with-sqlite3=shared,/usr' '--enable-json=shared' '--enable-zip=shared' '--without-readline' '--with-libedit' '--with-pspell=shared' '--enable-phar=shared' '--with-tidy=shared,/usr' '--enable-sysvmsg=shared' '--enable-sysvshm=shared' '--enable-sysvsem=shared' '--enable-posix=shared' '--with-unixODBC=shared,/usr' '--enable-fileinfo=shared' '--enable-intl=shared' '--with-icu-dir=/usr' '--with-enchant=shared,/usr' '--with-recode=shared,/usr'
Registered Stream Socket Transports => tcp, udp, unix, udg, ssl, sslv3, sslv2, tls
openssl
Код: Выделить всё
Success... Title is:
Код: Выделить всё
���ko�H���ϯ��Aj�\7Im��=�t.'= �-�2��%%�Y̏�S�ҥ�h�T�Ev��ӱd����������˅s_4mYWϞ0B�8E5�ge5�����O~���Ӧm�Wq}�W��u�4E�~��v�^M..̻��o����J���}z�WU�����������W�E9��Pd��rZ��ՕsS3;/��]�쯞^t�ue,����Vz��ɴ�xza��~?+�iS�t�������vw��b��x`�_��W���ys[��%���ij��%�y3'�,r����`���L����}�`O1��O���u��kY������{��|����ϜEsqS.�uY���]-_��v�h��j�^55�w1�͔�p�� l]��^3�)w%����PlS�|S��T�)z_�js��6�YS��C%�r8e���D�)D��Ӌ�����?����������K.�]߇(}��_�_V7�_����SA��T�0Ny��4R.��0�4���n�E �E�n���e>������/��ˇ8 ߅��&?>��m�jr�.o'}��ӬzfC��!@t�"� H�u!@6B��u�l3[�Q����n��]�P����~��mh�����_^���̊e]���T�L���.�:���R��e{I�wo|y��&^ؽ�������,f������rݠ^�����G��Џ�6O@?��#�~䠽[о�]��ʀ����4��i;�� �|z[Pg{�Eߐo�����ه�!�v�O��i@|�B�8�O��ٓ�^� �k#2�T^@�}��A�r�}��%�4�Tb���1{�B��y(������^����;%���'�m $|���CJ3����)Wx���8�}��Xډ�:��V����B�P;�iG�vd���#[�F�{��"O���sl�Ĉ�ܣ0k�b��F��9kr��w�ܸ���=�n���B�b�����̽��M79qp���%������}~�*�IQЌe��4�C%���'�W����}=�Ԁ�cL��v"?�x�;���";�F��z��������)I��*��GDž|�)���|꼾r~�����_��ͧ��l9)(a�l5��Th�g�b�Bg�)�̧�n��/��.��1l@�vb�C�%Nڠ=O�Еe,r]�).�������
РЕДАКТИРОВАТЬ: Я забыл упомянуть, этот код разработан в плагине WordPress в файле function.php. Возможно, это связано с проблемой, которую мы изучаем.
Подробнее здесь: https://stackoverflow.com/questions/324 ... ttps-sites
Мобильная версия