PHP程序如何发送syslog到远程服务器
给同事做了个 PHP 接口,转发发送短信的请求,同时要把发送记录发送到远程的 cacti 的 syslog 去 很简单,但是也不简单 首先是 PHP 服务器,是最简化编译的,php -m 查了一下 php -m [PHP Modules] Core ctype curl date dom fileinfo filter gettext hash iconv json libxml openssl pcre PDO pdo_sqlite Phar posix Reflection session SimpleXML SPL sqlite3 standard tokenizer xml xmlreader xmlwriter [Zend Modules] 居然没有 socket 模块,没办法,找到源代码,编译一个安装,原有的 php 安装路径是 /export/servers/php $ tar zxvf php-7.4.0.tar.gz $ cd php-7.4.0/sockets $ /export/servers/php/bin/phpize $ ./configure --enable-sockets --with-php-config=/export/servers/php/bin/php-config $ make $ make install 又看了一眼,是 php-fpm,居然没有 php.ini ,得,再生成一个,放在 /export/servers/php/lib/php.ini ...