PDA

View Full Version : Problem PDF indexing


lelectronique
11-13-2004, 06:43 AM
Hello,

Excuse me for my english, i'm french.

Config :
Server : IIS Windows XP Pro
Php : 4.3.8
Phpdig : 1.8.3

file config :
define('PHPDIG_INDEX_PDF',true);
define('PHPDIG_PARSE_PDF','C:\\Progra~1\\Ghostgum\\pstotext\\pstotxt3.exe') ;
define('PHPDIG_OPTION_PDF','');
define('PHPDIG_PDF_EXTENSION','.txt');


I wish to index the repertory containing http://localhost/gesdosi/fichier/verif files pdf "/"and here the result:

SITE : http://localhost/
Chemins exclus :
- @NONE@
1:http://localhost/gesdosi/fichier/verif/
(temps : 00:00:05)
Pas de liens dans la table temporaire

--------------------------------------------------------------------------------

liens trouvés : 1
http://localhost/gesdosi/fichier/verif/
Optimizing tables...
Indexation terminée !
--------------------------------------------------------------------------------

Thanks for your help
Best regards
Ludo

mleray
11-14-2004, 11:21 PM
as-tu essayé d'indexer uniquement un document pdf
ex : http://localhost/gesdosi/fichier/verif/machin.pdf ?

Sinon je te conseille de lire le post Readme de ce forum et de faire ce qui y est proposé.

lelectronique
11-15-2004, 02:52 AM
je viens d'essayer avec un fichier pdf en direct voici ce que j'obtiens :

SITE : http://localhost/
Chemins exclus :
- @NONE@

Warning: exec(): Unable to fork [C:\Progra~1\Ghostgum\pstotext\pstotxt3.exe ../admin/temp/11748322.tmp] in D:\Site\gesdosi\recherche\admin\robot_functions.php on line 1057
1:http://localhost/gesdosi/fichier/verif/02-11-2004_Chartres.pdf
(temps : 00:00:06)
Pas de liens dans la table temporaire

--------------------------------------------------------------------------------

liens trouvés : 1
http://localhost/gesdosi/fichier/verif/02-11-2004_Chartres.pdf
Optimizing tables...
Indexation terminée !


As-tu une petite idée ?
Merci de ton aide
Bonne journee

lelectronique
11-15-2004, 03:29 AM
en appliquant le readme comme indiqué j'obtiens l'erreur suivante :bang:

SITE : http://localhost/
Chemins exclus :
- @NONE@


Is result test http an array: 1
What is result test http status: PDF

Is result test an array: 1
What is result test status: PDF
Use is executable is set to: 0
Index the pdf is set to: 1
Parse the pdf is set to: C:\Progra~1\Ghostgum\pstotext\pstotxt3.exe
Does parse pdf exist: 1

Fatal error: Call to undefined function: is_executable() in D:\Site\gesdosi\recherche\admin\robot_functions.php on line 964

mleray
11-15-2004, 04:31 AM
J'ai moi même eu pas mal de problèmes avec les pdf.
J'ai dû installer php en cgi et j'utilise maintenant pdftotext (sur le site xpdf) car je n'ai jamais réussi avec pstotxt...

Sinon ton erreur fatale est juste due Ã* un echo utilisant la fonction is_executable(), j'ai remplacé la ligne par
if (USE_IS_EXECUTABLE_COMMAND==1)
echo "Is parse pdf executable: " . is_executable(PHPDIG_PARSE_PDF) . "<br>";
au cas où...

Je ne te donne pas vraiment de solution lÃ* mais tiens nous au courant de l'avancée de ton projet...

Ah oui et aussi, vérifie les droits de tes fichiers pdf, on ne sait jamais...

lelectronique
11-15-2004, 06:20 AM
oki pour la ligne Ã* modifier en cherchant j'avais vu que c'était un echo donc je l'avais désactivé.

Vu que je me bat toujours j'ai décidé de me tourner vers ce que tu utilise, en me disant cela devrait marcher et bien non :bang: :bang:
Voila l'erreur que j'obtiens :

SITE : http://localhost/
Chemins exclus :
- @NONE@


Is result test http an array: 1
What is result test http status: PDF

Is result test an array: 1
What is result test status: PDF
Use is executable is set to: 0
Index the pdf is set to: 1
Parse the pdf is set to: D:\Site\gesdosi\recherche\pdftotext.exe
Does parse pdf exist: 1

Warning: exec(): Unable to fork [D:\Site\gesdosi\recherche\pdftotext.exe ../admin/temp/57188672.tmp 2>&1] in D:\Site\gesdosi\recherche\admin\robot_functions.php on line 1069

Command is: D:\Site\gesdosi\recherche\pdftotext.exe ../admin/temp/57188672.tmp 2>&1
Result contains:
Return value is: -1

1:http://localhost/gesdosi/fichier/verif/02-11-2004_Chartres.pdf
(temps : 00:00:05)
Pas de liens dans la table temporaire

--------------------------------------------------------------------------------

liens trouvés : 1
http://localhost/gesdosi/fichier/verif/02-11-2004_Chartres.pdf
Optimizing tables...
Indexation terminée !



PAs beaucoup de changement donc, ceci dit je ne suis pas sur de mon coup dans l'installtion du CGI c'est la premiere fois, en passant j'ai installé la nouvelle version de PHP Ã* savoir la 4.3.9.
Est ce que cela peut être due Ã* mon serveur web ? (IIS5)

Je vais encore creuser car je veux a tout prix que cela fonctionne

Je te tiens au courant
@+
Ludo

Charter
11-15-2004, 06:57 AM
http://fr.php.net/manual/fr/ref.exec.php
http://bugs.php.net/bug.php?id=29001


Note on XP users: XP-Home edition does not allow to set rights directly on files and folders. You should use cacls command-line utility to do this.

For example:

cacls c:\windows\system32\cmd.exe /E /G IUSR_ADMIN2003:F

gives IIS user full access to cmd.exe (potential security hole!), so PHP can fork and execute external programs.

__________________

MORE ON THE UNABLE TO FORK MESSAGES IN WINDOWS:

I would like to confirm that this issue relates to permissions on %SYSTEMROOT%\SYSTEM32. The user (usually the anonymous login) must have execute permissions on cmd.exe

This is unlike most other programming languages. For example, in C the spawn and exec functions do not try to open a shell, they create the new process directly. PHP creates the new process via cmd.exe (or command.com) much like the C system() function. This is good for those of you who are trying to run batch files but this is very ineffecient for running other .exe files.

I feel uneasy about lifting permissions in my system32 directory but you can get around this by copying cmd.exe to your PHP directory. Windows will look there first and if it is not there it will check the path. Note: I mean the directory where php.exe is, not your script directory.

I have confirmed this by running filemon.exe while trying to execute a script, and you can see it trying to start the cmd.exe process.

__________________

This is not a problem in the PHP.
The problem is related to the execution permissions over the CMD to the
IUSR_machine and the ZIP exe file.

I do fork to GPG.exe in ISAPI/CGI modes. Using popen and proc_open.

According to the mode ISAPI/CGI the IWAM_/IUSR_ user must have read &
execute permissions over the CMD and the EXE file that you try to call.

This sentence put the needed permissions:

cacls cmd.exe /E /G MACHINE\IUSR_MACHINE:R

lelectronique
11-15-2004, 08:02 AM
Merci beaucoup Charter, cela fonctionne impeccable maintenant

:banana: :dance:

C'est vraiment superbe, je vais pouvoir continuer le développement de mon intranet, vraiment génial ce script :) je vais le recommander autour de moi

Merci Ã* tous les deux pour votre aide et bonne continuation

Bonne soirée
@+
Ludo