You are not logged in.

#1 2009-10-07 00:23:18

brando56894
Member
From: NYC
Registered: 2008-08-03
Posts: 681

Questions About PHP

I guess this is the best place to post this since my problems are with php and xml, and with compiling c code. I'm using the Phoronix Test Suite, which is entirely PHP based (you need to install the php package, not a whole webserver for it to work) and pretty poorly documented, and if you want to use extra features that dont come with the main package you have to install them yourself which is a major roadblock from someone like me who knows absolutely nothing about PHP. The program itself works fine, the problems I have are with using the additional features. Ive posted a thread over there yesterday but their forum doesnt seem to be that active.

First off to export your results to a pfd file you have to have the fpdf module (fpdf.php) but I have no idea where to put it, Ive googled it but all ive found is that you can put it anywhere that include() can look but I have no idea where include CAN look lol. Ive looked through /etc/php/php.ini and a few of the php files for the PTS but cant find it defined anywhere. Ive put it where all the other php modules are in /usr/lib/php/modules but when I try to use the module in PTS via phoronix-test-suite result-file-to-pdf it says that I need to have the fpdf program installed for it to work.

Second problem (?) I have is with viewing the results in a web browser. After a benchmark completes it asks you if you want to view the results in a web browser and if I select yes the results are shown but theyre nearly impossible to read since its all one big block of text with no spaces. The results are stored in an xml file called composite.xml and there are two other xml files in the same folder called pts-results-viewer.xsl and test-1.xml (which is just another results file from a previous test), there is also an html file called index.html which just references the composite.xml file in its code. I know very little about HTML and XML but almost everytime Ive tried to load an xml file in a web browser it displays either the source of the file or just a big unformatted block of text, so I dont know if this is really an error or if its supposed to be like this.

The third problem I have is with php-gtk. If I simply install the php-gtk package with pacman it installs fine but when I try to load the program from the console using phoronix-test-suite gui its gives me the following errors:

PHP Warning:  PHP Startup: php-gtk: Unable to initialize module
Module compiled with module API=20060613
PHP    compiled with module API=20090626
These options need to match
 in Unknown on line 0

The PHP GTK module must be loaded for the GUI.
This module can be found @ http://gtk.php.net/

I remember reading that php-gtk from the aur said that it used a modified php-gtk.ini and that I should tell all the programs to use that file instead of the default one, so with the php-gtk package installed via pacman I tried to open the program via php-gtk -c /etc/php/php-gtk.ini /usr/share/phoronix-test-suite/pts-core/phoronix-test-suite.php, it says the same thing.

If I try to compile php-gtk from source using aurbuild the compilation errors out about 85% of the way through (right at the GTK Coverage portion) with about 100 or so error: duplicate 'static' errors in various header files. Ive tried everything that I cant think of to try and remedy this but nothing seems to work.

These are the things that Ive tried:
building dependencies from the aur

syncing dependencies from pacman

removing the php package that I installed via pacman and building it with aurbuild --build-deps php52 (the package named php had errors in the pkgbuild so i used php52 and changed the package name to php in the pkgbuild) and then building php-gtk

following this guide to make sure that I have all the dependencies that I need and that they are compiled/installed in the order that they should be.


None of which have worked, they all give the same errors. The only thing I havent tried is manually compiling everything without using abs/aurbuild and following the instructions on the page I linked to.

In case its helpful, heres the php modules that are loaded:

[PHP Modules]                                                                                                                                                                                                  
Core                                                                                                                                                                                                           
ctype                                                                                                                                                                                                          
date                                                                                                                                                                                                           
dom                                                                                                                                                                                                            
ereg                                                                                                                                                                                                           
fileinfo                                                                                                                                                                                                       
filter                                                                                                                                                                                                         
gd                                                                                                                                                                                                             
gettext                                                                                                                                                                                                        
hash                                                                                                                                                                                                           
libxml                                                                                                                                                                                                         
mbstring                                                                                                                                                                                                       
mysqlnd                                                                                                                                                                                                        
pcntl                                                                                                                                                                                                          
pcre
posix
readline
Reflection
session
SimpleXML
SPL
standard
tokenizer
xml
xmlreader
xmlwriter
zlib

[Zend Modules]

Can anyone clue me in on any of this?

Last edited by brando56894 (2009-10-07 00:35:27)

Offline

#2 2009-10-07 02:55:25

deltaecho
Member
From: Georgia (USA)
Registered: 2008-08-06
Posts: 185

Re: Questions About PHP

PHP's include path is specified in your /etc/php/php.ini file, and, by default, should look something like include_path = ".:/usr/share/pear".  PHP's path is configured the same way as BASH's, where '.' means the current working directory, and each entry is separated with a colon, ':'.  You could either place the fpdf.php file under the /usr/share/pear directory, or put it where you want and add an extra entry to the include_path property of your php.ini.

As far as the XML and XSL files are concerned, the XSL file is actually a template used to transform the XML file into another format, probably (X)HTML.  Whenever I use XSL templates, I usually apply them to the XML file server side, and serve the client the XHTML output it generates, but there are ways to perform client-side transformations, such as with JavaScript and I believe you can apply the XSL template directly from the XML file, but I'll have to check on that.  If they are not too big, could you post the files here?

I've never used the php-gtk package, but try adding this to your php.ini, above or below the other extension lines:

extension=/usr/lib/php/20060613/php_gtk2.so

The php-gtk package looks like it includes several other modules, but try just adding that one first and see if it works.

Last edited by deltaecho (2009-10-07 02:57:06)


Dylon

Offline

#3 2009-10-07 03:38:04

brando56894
Member
From: NYC
Registered: 2008-08-03
Posts: 681

Re: Questions About PHP

Thanks for the info, I finally got the gui to work I manually compiled (almost) everything, stuff that errored out I cheated and installed with pacman and gtk-php finally compiled successfully, the pkgbuild I was initally using probably didnt include some of the flags that were needed. I had to use the configure flag --disable-gtktest while I was configuring php-gtk or else it would complain that gtk+ >= 2.6.0 wasnt installed even though I have gtk-2.16.5-1 installed.

After about 2 hours of downloading and compiling it still gave me the API error I mentioned before, needless to say I wasnt too happy. I googled again and found a bug-report about the same error and it said that its usually do to leftover files from an older installation. One person mentioned when they upgraded from ubuntu edgy to feisty-beta they got this error and found out that an old version of the php binary was there and the newest one was called php5 so they removed the old one and made a link from php5 to php. Just for the hell of it I checked out my /usr/bin for the same problem, it wasnt that obvious though. php was there, php-config was there and the link I had just created called php-gtk2 was there.

The previous two were from 9/27/09 while the link was obviously from today. I added .old to the names of php and php.conf and made a link from /usr/local/php-5.2.3/bin/php -> /usr/bin/php, added extension=php_gtk2.so to /etc/php/php.ini (actually it was already there from when I was messing around before) and ran phoronix-test-suite gui and finally it worked.

I tried place fpdf.php in my modules directory but its still not finding it and it (and i) are gettting confused since the tutorial I was following installed stuff into /usr/local/php-gtk-2.01 and not the default location. I'm going to go into my other installation and see if I can get everything to work with just pacman since I know what (one of the) actual problem(s) is. If not Im going to create a pkgbuild for it because this was a HUGE pain in the butt.

Heres the composite.xml, the PTS-results-viewer.xsl and the Index.html

Offline

#4 2009-10-07 19:30:23

deltaecho
Member
From: Georgia (USA)
Registered: 2008-08-06
Posts: 185

Re: Questions About PHP

Ok, the index.html file loads the composite.xml file, which calls the pts-results-viewer.xsl template itself.  You should be able to store all the files in the same folder and open just the index.html file from a web browser -- make sure the names of the files are all lower-case, though, because the filenames are case sensitive (change PTS-results-viewer.xsl to pts-results-viewer.xsl).

A breakdown:
1) If you look on line 4 of your index.html file, it loads the composite.xml file:

<meta http-equiv="REFRESH" content="0;url=composite.xml">

2) The composite.xml file then calls the pts-results-viewer.xsl template to transform it to XHTML:

<?xml-stylesheet type="text/xsl" href="pts-results-viewer.xsl" ?>

3) This set of transactions results in a nicely formatted list of stats for your machine (nice rig, BTW).

Last edited by deltaecho (2009-10-07 19:36:21)


Dylon

Offline

#5 2009-10-07 21:43:34

brando56894
Member
From: NYC
Registered: 2008-08-03
Posts: 681

Re: Questions About PHP

thanks for the breakdown and the compliments (the "Dual Core System" in the results isnt mine it was just a built in comparison) big_smile My next move is to add an SSD to it then Ill be content for a lil while lol

I'll see if all this works when I get back to my pc, Ive actually stopped messing around with PTS for the moment and switched my focus to making pkgbuilds that will compile php-cli and php-gtk correctly to work with PTS since the current pkgbuilds (and repo packages) dont want to work correctly with it. Its a HUGE pain in the butt to get PTS working correctly and it took way too long to compile everything manually from source just to get the GUI working.

I just ironed out all of the bugs out of my php-cli pkgbuild now I have to move onto the pkgbuild for php-gtk. It shouldnt be too hard since all I'm doing is modifying the current pkgbuild thats in the aur. After I finish the php-gtk pkgbuild the next step will be to integrate it into another pkgbuild that will compile the cli version of PHP, compile php-gtk, and then install PTS.

edit: I just copied the source and re-created the files on the pc im on now and everything displays as it should. Thats really odd that PTS creates the results with capitals and then references it as lowercase since theyre case sensitive.

Last edited by brando56894 (2009-10-07 21:53:06)

Offline

#6 2009-10-08 00:57:47

brando56894
Member
From: NYC
Registered: 2008-08-03
Posts: 681

Re: Questions About PHP

I just tried to open one of my results files and it turns it they worked in the first place, it was just that when I double clicked index.html it would open it in konqueror (while it was in file browser mode) and apparently not parse it correctly. I opened it with firefox and it works perfectly and looks ten times better than what I posted since other files werent included. Heres how it really looks: Pic 1 Pic 2

Offline

#7 2009-10-08 01:40:54

deltaecho
Member
From: Georgia (USA)
Registered: 2008-08-06
Posts: 185

Re: Questions About PHP

Cool!


Dylon

Offline

Board footer

Powered by FluxBB