Menu

require v. require_once - cannot redefine <function> ...

2017-12-16
2017-12-16
  • David Smart

    David Smart - 2017-12-16

    PhpGedView v 7185, PHP v 7.0.24, Apache/2.2.34

    I assume this may be related to my server/php version. Some pages would fail (cannot redefine ...). I didn't find the redundant include-path to the functions that failed, but that seems to be the root cause.

    I did a search for all "require" of the function hosting file and changed them to "require_once". Web research suggests that require is faster than require_once, and that there may be cases where a module would legitimately be multiply included. While doing this search/replace, I noticed many other "require" statements, but thought it best not to replace them all.

    In any case, to the best of my limited testing, the require_once was the fix, and introduced no new issues.
    regards, David

     
  • Gerry Kroll

    Gerry Kroll - 2017-12-16

    Ummm, .....
    It would be very helpful if you were to reproduce the error messages in their entirety. I can't check your fixes for being appropriate if I don't know where the errors are occurring.

     
  • David Smart

    David Smart - 2017-12-16

    agreed. I may revert changes to try to reproduce this more precisely. In the meantime, I'm on another item (geonames autocompletion)
    Update: I did revert, and will work to reproduce this, taking more care in the next report.

     

    Last edit: David Smart 2017-12-17

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.