php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77968 extension name must not include funny characters
Submitted: 2019-05-04 12:54 UTC Modified: 2019-05-26 04:22 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: dallas at ekkysoftware dot com Assigned:
Status: No Feedback Package: *Compile Issues
PHP Version: 7.1.29 OS: linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2019-05-04 12:54 UTC] dallas at ekkysoftware dot com
Description:
------------
Hello PHP,

I created an extension with ./ext_skel --extname=texas_api and this little script was able to create the extension skeleton, but used the name 'texas_api'. After successfully developing and running on Windows, I then tried to port to Linux. On Linux, the phpize gave an error and then the ./configure also erred and the make created a library that was rejected by the system, as 'not a php library'.

After testing and testing, I finally retired creating the extension but with the name texasapi instead. This worked without a problem.

Can you please update ./ext_skel to make sure that the all illegal characters are removed from the extension name, as this can cause unpredictable results.  

Test script:
---------------
Only on Linux:-

./ext_skel --extname=texas_api
phpize
./configure
make
make test

./ext_skel --extname=texasapi
phpize
./configure
make
make test

Expected result:
----------------
no error

Actual result:
--------------
NOTICE: PHP message: PHP Warning:  PHP Startup: Invalid library (maybe not a PHP library) 'texas_api.so' in Unknown on line 0

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-05-04 13:33 UTC] petk@php.net
Hello, there probably is some step in between those. Do you maybe have the step where this happens? Maybe when trying to use the extension or something?

On PHP 7.1 up to master branches I cannot reproduce this and I think it all works the same. On PHP 7.3 there is now also the ext/ext_skel.php script. Maybe try starting a new extension with that (the script is a bit lacky in features and functionality but it might server as an initial starting point)...

Thank you.
 [2019-05-12 18:24 UTC] petk@php.net
-Status: Open +Status: Feedback
 [2019-05-12 18:24 UTC] petk@php.net
Hello, I've tested this again with the latest PHP-7.4 branch (and its ext_skel.php script) and it seems to work ok. If I've missed something, can you please try again with this script and its belonging skeleton:
https://github.com/php/php-src/blob/PHP-7.4/ext/ext_skel.php
https://github.com/php/php-src/tree/PHP-7.4/ext/skeleton

Valid extension name characters are:
- starting with a lowercase letter
- following any number of lowercase letters, numbers, or underscores

Thanks.
 [2019-05-26 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 17:01:30 2024 UTC