adekk Posted October 10 Posted October 10 Hi, What kind of module is needed to send mails using PHP? I see: A test email could not be sent. Check the settings entered are correct or contact your hosting or SMTP provider for more information. preg_replace(): Passing null to parameter #2 ($replacement) of type array|string is deprecated I'm not able to use it like this. I'm the server owner. I'm using latest version (up-to-date), only one extension for topic thumbnails. In the support section - I see 0 issues (also 0 recommendations). My server is using Apache and PHP 8.1.30 currently. Maybe I'm missing some PHP module for that?
Marc Posted October 11 Posted October 11 You have warnings switched on within your PHP settings. You should have these switched off in a production environment, and is what I causing your problems.
adekk Posted October 11 Author Posted October 11 I have: error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_WARNING (I've adde E_WARNING). Same error.
Marc Posted October 11 Posted October 11 E_NOTICE would be another. If its then still showing, you need to check with your hosting company, as it shouldnt be
adekk Posted October 11 Author Posted October 11 I'm the server owner. No need to check it. I'll add E_NOTICE. We'll see.
adekk Posted October 11 Author Posted October 11 (edited) This is super strange. I've created testing script: <?php // Set error reporting based on your PHP.ini settings error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_WARNING & ~E_NOTICE); // Display the current error reporting level echo "Current error reporting level: " . error_reporting() . "<br>"; // Forcefully trigger a deprecated function (strftime) echo "Testing strftime() function (deprecated in PHP 8.1+):<br>"; echo strftime('%Y-%m-%d %H:%M:%S') . "<br>"; // Test if warnings are being displayed echo "This will trigger a warning:<br>"; echo 2 / 0; // Division by zero // Test if notices are being displayed echo "This will trigger a notice:<br>"; echo $undefined_variable; // Add some output at the end to verify that the script continues to run echo "<br>Script execution completed!"; ?> Output: Current error reporting level: 22517 Testing strftime() function (deprecated in PHP 8.1+): 2024-10-11 21:55:55 This will trigger a warning: We can now exclude php settings/conf. Edited October 11 by adekk
Jim M Posted October 11 Posted October 11 If you have questions on your PHP configuration, you will need to contact a server administrator to assist you.
adekk Posted October 11 Author Posted October 11 Not sure if you are following the thread. Probably you are using GPT or something to reply. I don't need server administrator. Server is ours. We can change settings anytime we want. I just posted script that is showing you it's not php configuration. Scripts are not showing warnings or errors but in Admin Panel I can still see this error. Is there a special settings for that?
Jim M Posted October 11 Posted October 11 3 minutes ago, adekk said: Not sure if you are following the thread. Probably you are using GPT or something to reply. I don't need server administrator. Server is ours. We can change settings anytime we want. I just posted script that is showing you it's not php configuration. Scripts are not showing warnings or errors but in Admin Panel I can still see this error. Is there a special settings for that? You are having issues with your PHP configuration as my colleague stated there. Additionally, what you have shown in your PHP code snippet above is that you are actively changing the Error Reporting prior to running your code so nothing will take from your configuration. Thus, if you have questions about your configuration, you will need contact a server administrator as we only support our software. We cannot tell you how to configure your server or help troubleshoot that. It is worth mentioning that I am not seeing an error on my test server when using PHP mail.
adekk Posted October 11 Author Posted October 11 (edited) Quote You are having issues with your PHP configuration as my colleague stated there Yes. That was the idea. But I showed you - I changed configuration to hide all errors and I'm still having this. Here's phpinfo (printed by Invision Community - support section) As you can see it is turned off. Edited October 11 by adekk
Jim M Posted October 11 Posted October 11 1 minute ago, adekk said: Yes. That was the idea. But I showed you - I changed configuration to hide all errors and I'm still having this. 6 minutes ago, Jim M said: what you have shown in your PHP code snippet above is that you are actively changing the Error Reporting prior to running your code so nothing will take from your configuration. As mentioned previously, this does not do what you believe you did. You change the reporting in the code snippet so you are not pulling your settings from your configuration, which is how our software operates.
adekk Posted October 11 Author Posted October 11 (edited) 3 minutes ago, Jim M said: As mentioned previously, this does not do what you believe you did. You change the reporting in the code snippet so you are not pulling your settings from your configuration, which is how our software operates. That's right. I changed it and remove it. Forgot to tell it. I changed it and remove this line - same result. Also I've put here screenshot from Invision Community phpinfo. What I did right now- I've used Support section in admin panel, disable all customization, default theme was showed - same result. I checked .htaccess if there is not line that is changing something but now. I didn't touch it. Honestly - that's the only option that is not working. I wanted to switch it from smtp (because of mail's limit) Edited October 11 by adekk
Jim M Posted October 11 Posted October 11 Keep in mind the errors mentioned in your test code do not cover deprecation error messages such as what you original post screenshot is stating so this is why you are not getting the error to shine through.
Marc Posted October 14 Posted October 14 We have a bug report for the notice itself in our bug tracker. However as mentioned previously, your hosting should be suppressing those. Its not possible for us to tell you why your host isnt On 10/11/2024 at 9:07 PM, adekk said: Probably you are using GPT or something to reply. Just wanted to respond to this part also, to let you know we are very real people LOL
adekk Posted October 14 Author Posted October 14 @Marc 🙂 Sorry but that previous message looks like gtp-generated. It's a common issue. A lot of companies is using gpt-bots as support (first line). Regarding this mail. I fixed it. And ... This is strange. Like I said - I have all showing erorrs turned off. The problem was ... POSTFIX. After reconfiguring postfix and restarting the service I was able to make it work. WIthout changing php configuration. If you see this error - make sure postfix is properly configured (if you are using postfix but I believe in most cases it will be postfix).
Recommended Posts