php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55636 auto_prepend_file do not work sometimes
Submitted: 2011-09-07 19:11 UTC Modified: 2012-05-24 23:50 UTC
From: raphpell at cario dot fr Assigned:
Status: Not a bug Package: *Configuration Issues
PHP Version: Irrelevant OS: window
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: raphpell at cario dot fr
New email:
PHP Version: OS:

 

 [2011-09-07 19:11 UTC] raphpell at cario dot fr
Description:
------------
[EN]
With Apache I consider css files as php.
I configure my php.ini file with auto_prepend_file = "redirection.php" and sometimes this file was not prepend, always for the same file.

I try differents versions of PHP and Apache, and software like easyPHP and WampServer but it persist in window. In Mac all work fine.

[FR]
Les détails techniques
    Je fait considérer grâce à Apache mes fichiers css comme étant des fichiers php.
    Grâce à ma configuration php, je préfixe tous mes fichiers php par un autre nommé redirection.php.
    Si un fichier css est détecté par mon fichier php l'entête http "Content-Type:text/css" est ajouté.
    L'accès à un fichier css entraîne, si les configurations de l'application le demande, une compression et un encodage de son contenu, et la mise en cache du résultat avant d'envoyer le résultat au navigateur. 

Un jour j'ai remarqué, qu'une page sur trois, l'aspect visuel d'éléments html ne respectait pas la feuille de style externe jointe bizarrement considéré comme étant de l'html.

Observations sur le fichier css 'érroné'
    Son Content-Type est text/html au lieu d'être text/css
    Il ne reconnait pas une constante php défini dans le fichier redirection.php, une erreur php est générée dedans.
    Aucun cache n'est généré dans tous les cas 

On remarque bien que dans une et une seule de mes pages, le fichier css est considéré comme php mais n'est pas préfixé par mon fichier redirection.php.

Conclusion
En passant sou Mac tout fonctionne correctement ! Sous windows avec WampServer, j'ai essayé les versions Apache et php de mon Mac entre autre, mais rien n'y fait... J'ai même essayé sur EasyPHP, et toujours le même bug est apparu !!!

Pour window, j'ai tout simplement renoncé de le mettre en externe, j'ai inclus le css dans la page html. Je n'ai jamais trouvé d'où pouvait venir se phénomène. 

Test script:
---------------
<link rel="stylesheet" type="text/css" href="/path/to/css/file/">

Expected result:
----------------
My css file must be prepended by my php file redirection.php.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-05-24 23:50 UTC] felipe@php.net
-Status: Open +Status: Not a bug
 [2012-05-24 23:50 UTC] felipe@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.


 [2013-04-27 12:43 UTC] raphpell at cario dot fr
JE VOUS SIGNALE QUAND MEME QUE DE TEMPS EN TEMPS auto_prepend_file NE FONCTIONNE PAS SOUS WINDOWS !!! JE N'ARRIVE PAS A TROUVER POURQUOI.
 [2013-04-27 13:01 UTC] raphpell at cario dot fr
Le fichier inclus peut-être différent : voir include_path.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 22:01:28 2024 UTC