Solved - Phpinfo page not displaying

Hello - I am using shared hosting for IN. My hosting provider has asked to put phpinfo.php (to display php related information) on the root folder for troubleshooting purpose. I added this file, but I see 404 - Not Found error. I tried another php file, but same error. I have also checked .htaccess file but I don’t see any strange directive which might conflict with phpinfo.

Anyone has any suggestion(s)?

Hi,

Have you put the file in the root folder of the app or the root folder of the web server?

I put it in the root folder of the app. When I did the same on the root folder of the web server, it worked.

A side note, I did notice the .htaccess file in the root folder of the web server is different than the root folder of the app.

Glad to hear it’s sorted, thanks for the update!

I am sorry, I wasn’t clear. I was trying to highlight differences between web server and app root folders.

My issue is not resolved yet.

What problem are you seeing? I thought the issue was displaying the phpinfo page.

The .htaccess file in the app folder comes with the app whereas the one in root folder of the web server is the default from the server. I’d expect the files to be different.

I am unable to show phpinfo page when accessing IN. However, it worked fine when trying to access from web server root.
Need some help in pin pointing the issue.

It may help to put the file in the public folder

@hillel - Thanks for the follow up.

Let me explain the issue in detail. Keep in mind I am using IN on a shared hosting.
I have below two folders:
public_html (a .htaccess file exist)
portal.website.com (a different .htaccess file exist)

When I put phpinfo.php in public_html folder, it worked.
When I put phpinfo.php in portal.website.com folder, it give 404 - not found error.

I have set the same php version 8.1 for both.

I have noticed below error in the error_log file in portal.website.com root folder:
[25-Oct-2022 15:00:02 UTC] PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 2621440 bytes) in /home/bargainp/portal.bargainpbx.com/vendor/composer/autoload_static.php on line 1013

I have asked shared hosting provider and the support wanted me to put phpinfo.php on the root folder to see php related info.

I hope things are clear now.

Thanks for the details, from the error it looks like you need to increase the PHP memory limit on the server.

I have already changed memory_limit to 512M in php.ini in both public_html and portal.website.com root folders.

@david do you have any suggestions?

@hillel - I have solved this issue by commenting out below line in .htaccess file:

RewriteRule ^(.*)$ public/$1 [L]

I know it is there for a reason, but I want hosting provider to see php info for troubleshooting.

I hope this is helpful for someone with same issue.

Glad to hear it, thanks for sharing the solution!