php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57773 SAM requires a PHP file
Submitted: 2007-08-06 11:52 UTC Modified: 2017-04-01 21:34 UTC
From: philip at roshambo dot org Assigned:
Status: Wont fix Package: sam (PECL)
PHP Version: 5_2 CVS-2007-08-06 OS: All
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: philip at roshambo dot org
New email:
PHP Version: OS:

 

 [2007-08-06 11:52 UTC] philip at roshambo dot org
Description:
------------
Enabling the SAM extension causes problems for users due to the following code:

PHP_RINIT_FUNCTION(sam)
{
    if (zend_eval_string("require_once(\"SAM/php_sam.php\");", NULL, "sam_factory" TSRMLS_CC) != SUCCESS) {
        /* set the standard error no for unsupported protocol   */
        return FAILURE;
    }
    return SUCCESS;
}

A user who ends up enabling this PECL extension (for example, via the PHP installer) ends up with problems especially users who simply install a lot of PECL extensions because they can (the newish installer makes this so easy).

This could be a documentation problem? The php_sam.php file exists in pecl/sam/ but... something needs to be done here as this doesn't feel right. AFAICT, a person must hunt this file down from pecl/sam/, stick it in a SAM/ that's available in include_path, and then it'll work.

I just now helped a user solve this and notice this problem comes up from time to time all over the web.

Reproduce code:
---------------
<?php echo 'oh sam...'; ?>

Expected result:
----------------
oh sam...

Actual result:
--------------
PHP Warning:  require_once(SAM/php_sam.php): failed to open stream: No such file
PHP Fatal error:  require_once(): Failed opening required 'SAM/php_sam.php'

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-04-01 21:34 UTC] tpunt@php.net
-Status: Open +Status: Wont fix
 [2017-04-01 21:34 UTC] tpunt@php.net
Due to this extension not seeing any activity since 2007, this issue will not be fixed. We are therefore closing this now.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 18:01:35 2025 UTC