introduction screenshots faq forum blog modules components download
Please use the search function and/or read the FAQ first.

Go to Topic: PreviousNext
Go to: Message ListNew TopicSearchLog InPrint View

php files not executed by Apache



Posted by: onlit4regs
April 28, 2008 06:05PM
Hi,
I've installed easyphp 2.0b1 and when I try a simple file test.php with these lines:
<html><body>
<? echo "php test"; ?>
</body></html>

It doesn't work, Apache do not execute the PHP code, it returns the file exactly the same as the source (all the php code is visible through the browser)
What's wrong ? is there another beta file of easyphp 2 ?
thanks for your help

et si quelques francais peuvent me repondre en francais, mon probleme est qu'avec easyphp 2.0b1, je n'arrive pas a faire executer mes fichiers php par apache. il renvoie le fichier au navigateur exactement comme le fichier source (le code php est visible sur le navigateur)
merci
Options: ReplyQuote
Posted by: Aphrael
April 28, 2008 06:59PM
<?php et pas <?

Aphrael...

--
The Doctor: Sonic Blaster ? Fifty-first century ? Weapons factory at Villengard, yes?
Captain Jack Harkness: You've been to the factories?
The Doctor: Once.
Captain Jack Harkness: Well, they're gone now. The main reactor went critical, destroyed the whole lot.
The Doctor: Like I said. Once.
Options: ReplyQuote
Posted by: Thom
April 30, 2008 11:56AM
I have exactly the same problem... I have a lot of websites that were working correctly on easyphp 1.8

The 2.0 release not seems to interprate the php code so my code is written in my html page. Is it a joke from easyphp team ? or Are we the only ones that have this problem ?

The more annoying is that there is no 1.8 version that is always available for download from any websites. I think it's really stupid not to offer the choice to download the previous versions of Easyphp.

Et pour ceux qui parlent le français ben j'ai pas non plus d'interprétation de PHP dans mes pages donc ça recrache le code tel quel... Easyphp 2.0 c'est une blague ? Et en plus impossible de recharger la version 1.8 antérieure qui était stable !!! Du pur foutage de gueule quoi...

Franchement c'est ridicle tout ça...
Options: ReplyQuote
Posted by: Amour
April 30, 2008 08:51PM
Il faut lire les réponses ;)

Ne pas utiliser les short tags
Options: ReplyQuote
Posted by: Thom
May 01, 2008 07:24AM
Merci pour ta réponse... Amour. Mais je n'y comprends rien...

"Lire les réponses... ne pas utiliser les short tags"
Je suppose que tu parles de "<?php et pas <?"

Et bien je l'ai lu cette réponse... mais tous mes sites utilisent "<?php" et pas "<?" et malheureusement le résultat est absolument le même.

As tu une autre piste ?
Options: ReplyQuote
Posted by: Amour
May 01, 2008 08:34PM
Quelle est l'extension de fichier ? bien .php et pas .php.txt (ça peut arriver) ?

Aussi, comment appelez-vous les fichiers en local, est-ce bien par [localhost] et surtout pas en double-cliquant dessus dans l'explorer ?
Options: ReplyQuote
Posted by: ibCubed
May 08, 2008 07:11AM
The short_open_tag directive is set to Off by default. Therefore, you'll need to use <?php as your opening tag instead of <?

Or, rather than changing all of your php files, you can set the directive to On. You'll need to update the php.ini file located in the conf_files directory.

Example:
C:\Program Files\EasyPHP 2.0b1\conf_files\php.ini

Open the php.ini file with a text editor and search for:
short_open_tag = Off
Change it to
short_open_tag = On
and save the file.

Now php code using <? should work.
Options: ReplyQuote
Posted by: Thom
May 08, 2008 11:22AM
Thank you for your responses... but I have always used the <?php tag in my code and I always run the php files (not php.txt) using the localhost !!! I'm making websites for 5 year now so I know a litle how to use easyphp...
In fact all is working fine with the 1.8 version !!!

So I really don't understand from where the error can come.
I put an example of my code and a screenshot of the easyphp 2.0 interpretation in IE7 :

Link to the screenshot : [www.attrape-reves.net]

Here is the example of my main php code :
<?php
// INCLUDES
include('global-variables.php');
include('parse-functions.php');

// Variables d'environnement
$PHP_SELF = $_SERVER['PHP_SELF'];
?>

and bit far away in my php document :

<?php
// SELECTION DES ENREGISTREMENTS
include('admin/connexion.php');
$query = "SELECT * FROM agenda WHERE status_id=2 ORDER BY date ASC";
$data = mysql_query($query) or die("selection des enregistrements impossible");
$nbr_result = mysql_num_rows($data);
// AFFICHAGE DES RESULTATS
if ($nbr_result==0) echo $NO_RESULT;
$i = 1;
echo $beginTabList;
while (list($id,$status_id,$title,$text,$date,$link,$textlink) = mysql_fetch_row($data)){
parseNews($i,$id,stripslashes($title),stripslashes($text),$date,$link,$textlink);
$i++;
}
echo $endTabList;
?>

In this main php document, I use Includes that contains the global variables that you can find in my screenshot :

<?php
$beginTabList = '<table class="boxform" width="100%" cellspacing="0">';
$endTabList = '</table>';
$NO_RESULT ='<table width="100%" heigth="15" bgcolor="#B9242E"><tr><td><span align="center" class="texte Blanc">Il n\'y a aucun enregistrement dans la base !</span></td></tr></table>';
$UPLOADFILE_OK ='<table width="100%" heigth="15" bgcolor="#66DD00"><tr><td><span align="center" class="texte Blanc">Transfert du fichier '; $UPLOADFILE_OK_END =' effectué avec succès !</span></td></tr></table>';
$DELETEFILE_OK ='<table width="100%" heigth="15" bgcolor="#66DD00"><tr><td><span align="center" class="texte Blanc">Suppression du fichier '; $DELETEFILE_OK_END =' effectuée avec succès !</span></td></tr></table>';
$INSERT_OK ='<table width="100%" heigth="15" bgcolor="#66DD00"><tr><td><span align="center" class="texte Blanc">Ajout dans la BDD effectué avec succès !</span></td></tr></table>';
$UPDATE_OK ='<table width="100%" heigth="15" bgcolor="#66DD00"><tr><td><span align="center" class="texte Blanc">Update de la BDD effectuée avec succès !</span></td></tr></table>';
$ERROR_INSERT_FAILED ='<table width="100%" heigth="15" bgcolor="#B9242E"><tr><td><span align="center" class="texte Blanc">Problème au moment de l\'insertion dans la base de données !</span></td></tr></table>';
$ERROR_FIELDS_EMPTY ='<table width="100%" heigth="15" bgcolor="#B9242E"><tr><td><span align="center" class="texte Blanc">Erreur : vérifiez que les champs sont bien remplis !</span></td></tr></table>';
$ERROR_FIELDS_MINI ='<table width="100%" heigth="15" bgcolor="#B9242E"><tr><td><span align="center" class="texte Blanc">Erreur : vous devez remplier au moins 1 champ !</span></td></tr></table>';
$ERROR_UPLOADFILE ='<table width="100%" heigth="15" bgcolor="#B9242E"><tr><td><span align="center" class="texte Blanc">Problème au moment du tranfert de fichier !</span></td></tr></table>';
?>

Thanks for tour responses.
Thomas.
Options: ReplyQuote
Posted by: norberto
May 14, 2008 09:30AM
I cannot read includes even calling from the regular root "C:\programa\EasyPHP 2.0b1\www" by using this code b.e.:
<?php include "sometextorvariables.php"; ?>
Options: ReplyQuote
Posted by: Aphrael
May 14, 2008 01:53PM
Yeah, because this is not the code you are supposed to use.
include("yourincludedfile.php");

Aphrael

--
The Doctor: Sonic Blaster ? Fifty-first century ? Weapons factory at Villengard, yes?
Captain Jack Harkness: You've been to the factories?
The Doctor: Once.
Captain Jack Harkness: Well, they're gone now. The main reactor went critical, destroyed the whole lot.
The Doctor: Like I said. Once.
Options: ReplyQuote


Go to: Message ListSearchLog In
Your Name: 
Your Email: 
Subject: 
Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.