Jump to content

Contents of php.ini are displayed at top of page!


mjm

Recommended Posts

Hi all,

 

I just installed WHMCS, and am having a problem.

 

The contents of the php.ini file are being displayed after login, and at the top of each page accessed in the "Portal."

 

I installed WHMCS on a shared server at 1and1.com. Since this is a shared server, I don't have permissions to make changes to the global php.ini file. So I placed a php.ini file in the root WHMCS directory, then created a link to that php.ini file in every sub-directory that has a .php file.

 

Following the "Further Security Steps" instructions, I moved the "attachments", "downloads" and "templates_c" directories, and updated configuration.php to reflect the new locations.

 

I also renamed the admin directory, and added the $customadminpath to the configuration.php file.

 

When I go to the admin login screen, I'm able to enter the admin username and password. I then see a page which displays the contents of the php.ini file.

 

If I then go to http://www.mydomain.com/whmcs, I see the "Portal Home" page. However, at the top of the "Portal Home" page, and of every page I access, the contents of the php.ini file are displayed.

 

I've searched this forum, as well as a number of Google searched, but I can't find any information related to this problem.

 

I would appreciate any help to resolve this issue.

Link to comment
Share on other sites

Hi all,

 

I did some more work on this since posting my question.

 

It turns out that WHMCS is displaying the php.ini file that I put in the /includes/hooks directory.

 

I removed the php.ini file in that directory, and the problem is resolved.

 

I haven't yet looked into the reason for this, but I suspect that anything in the /includes/hooks directory gets automatically merged into each .php file in the system, enabling developers to make enhancements to the WHMCS system without accessing the source code, or editing each .php file.

 

Thanks for the quick resolution! ;)

Link to comment
Share on other sites

"...I suspect that anything in the /includes/hooks directory gets automatically merged into each .php file in the system, enabling developers to make enhancements to the WHMCS system without accessing the source code, or editing each .php file"

 

Looks like I was pretty close!

 

More details on how "hooks" work can be found here:

 

http://wiki.whmcs.com/Hooks

Link to comment
Share on other sites

Hah, I discovered this the other day too while editing some custom hooks. Opening a file in there in vi will break a lot of stuff because whmcs will read the .swp file created by the editor.

 

I would think they should ignore anything that isnt a .php extension.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated