Page 1 of 1

Can't get libxslt support with php5 and apache2 on win XP

Posted: Mon May 21, 2007 2:21 pm
by sullivans
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


I've uncommented extension=php_xsl.dll and extension=php_xslt.dll in php.ini (located in c:\windows). In the same file I set extension_dir to "C:\Program Files\PHP\ext". In the directory C:\Program Files\PHP\ext I have libexslt.dll, libexslt.exp, libexslt.lib,libexslt_a.lib, libxml2.dll, libxml2.exp, libxml2.lib, libxml2_a.lib, libxslt.dll, libxslt.exp, libxslt.lib, libxslt_a.lib, php_xsl.dll, and php_xslt.dll. This "should" be my extensions directory.

Now that should be my extensions directory. Yet for some reason when I do phpinfo() in a test php page xsl or libxslt doesn't even show up in the output. However libxml does. I just can't seem to figure out how to get libxslt support with php and apache. I'm pretty sure my code is correct; when I run it I just get a blank white screen. I'll show you my xml, xsl, and php file just in case anyways:

order.xml:
[syntax="xml"]
<?xml version="1.0" ?>
<Order>
  <Account>9900234</Account>
  <Item id="1">
    <SKU>1234</SKU>
    <PricePer>5.95</PricePer>
    <Quantity>100</Quantity>
    <Subtotal>595.00</Subtotal>
    <Description>Super Widget Clamp</Description>
  </Item>
  <Item id="2">
    <SKU>6234</SKU>
    <PricePer>22.00</PricePer>
    <Quantity>10</Quantity>
    <Subtotal>220.00</Subtotal>
    <Description>Mighty Foobar Flange</Description>
  </Item>
  <Item id="3">
    <SKU>9982</SKU>
    <PricePer>2.50</PricePer>
    <Quantity>1000</Quantity>
    <Subtotal>2500.00</Subtotal>
    <Description>Deluxe Doohickie</Description>
  </Item>
  <Item id="4">
    <SKU>3256</SKU>
    <PricePer>389.00</PricePer>
    <Quantity>1</Quantity>
    <Subtotal>389.00</Subtotal>
    <Description>Muckalucket Bucket</Description>
  </Item>
  <NumberItems>1111</NumberItems>
  <Total>3704.00</Total>
  <OrderDate>07/07/2002</OrderDate>
  <OrderNumber>8876</OrderNumber>
</Order>
order.xsl:

Code: Select all

<?xml version="1.0"  ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:param name="column" select="'SKU'"/>
 <xsl:param name="order" select="'ascending'"/>
  <xsl:template match="/">
    <html>
      <body>
        <xsl:apply-templates select="Order">
          <xsl:with-param name="sortcolumn" select="$column" />
          <xsl:with-param name="sortorder" select="$order" />
        </xsl:apply-templates>
      </body>
    </html>
  </xsl:template>

  <xsl:template match="Order">
    <xsl:param name="sortcolumn" />
    <xsl:param name="sortorder" />
    <table border="1">
      <tr>
        <th>Account</th>
        <th>SKU</th>
        <th>Description</th>
        <th>Price</th>
        <th>Quantity</th>
        <th>Subtotal</th>
      </tr>
      <xsl:apply-templates select="Item">
        <xsl:sort select="*[name()=$sortcolumn]"  order="{$sortorder}" />
      </xsl:apply-templates>
    </table>
  </xsl:template>

  <xsl:template match="Item">
    <tr>
      <td><xsl:value-of select="../Account" /></td>
      <td><xsl:value-of select="SKU" /></td>
      <td><xsl:value-of select="Description" /></td>
      <td><xsl:value-of select="PricePer" /></td>
      <td><xsl:value-of select="Quantity" /></td>
      <td><xsl:value-of select="Subtotal" /></td>
    </tr>
  </xsl:template>    
</xsl:stylesheet>
<?xml version="1.0"  ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:param name="column" select="'SKU'"/>
 <xsl:param name="order" select="'ascending'"/>
  <xsl:template match="/">
    <html>
      <body>
        <xsl:apply-templates select="Order">
          <xsl:with-param name="sortcolumn" select="$column" />
          <xsl:with-param name="sortorder" select="$order" />
        </xsl:apply-templates>
      </body>
    </html>
  </xsl:template>

  <xsl:template match="Order">
    <xsl:param name="sortcolumn" />
    <xsl:param name="sortorder" />
    <table border="1">
      <tr>
        <th>Account</th>
        <th>SKU</th>
        <th>Description</th>
        <th>Price</th>
        <th>Quantity</th>
        <th>Subtotal</th>
      </tr>
      <xsl:apply-templates select="Item">
        <xsl:sort select="*[name()=$sortcolumn]"  order="{$sortorder}" />
      </xsl:apply-templates>
    </table>
  </xsl:template>

  <xsl:template match="Item">
    <tr>
      <td><xsl:value-of select="../Account" /></td>
      <td><xsl:value-of select="SKU" /></td>
      <td><xsl:value-of select="Description" /></td>
      <td><xsl:value-of select="PricePer" /></td>
      <td><xsl:value-of select="Quantity" /></td>
      <td><xsl:value-of select="Subtotal" /></td>
    </tr>
  </xsl:template>    
</xsl:stylesheet>
order.php:[/syntax]

Code: Select all

<?php
$xmlfile = "order.xml";
$xslfile = "order.xsl";
$args = array("column"=>"Quantity", "order"=>"descending");
$engine = xslt_create();
$output = xslt_process($engine, $xmlfile, $xslfile, NULL, NULL, $args);
print $output;
xslt_free($engine);
?>
If anyone can tell me what I need to do to get php to work with xslt it would be greatly appreciated.


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Tue May 22, 2007 12:18 am
by volka
Yet for some reason when I do phpinfo() in a test php page xsl or libxslt doesn't even show up in the output.
Meaning the script and the xsl file have nothing to do with this error.
What does

Code: Select all

<?php
$ini = get_cfg_var('cfg_file_path');
echo 'php.ini: ', $ini, "<br />\n";
echo 'version: ', phpversion(), "<br />\n";
echo 'sapi: ', php_sapi_name(), "<br />\n";

foreach(file($ini) as $l) {
	if ( false!==strpos($l, 'xsl') ) {
		echo $l, "<br />\n";
	}
}
print.

Posted: Tue May 22, 2007 6:50 am
by sullivans
The code you entered prints this:
php.ini:
version: 5.2.2
sapi: apache2handler
The only thing I changed was this line:

Code: Select all

$ini = get_cfg_var('C:/WINDOWS/php.ini');
php.ini (I had to remove most comments):
; Enable the PHP scripting language engine under Apache.
engine = On

; Enable compatibility mode with Zend Engine 1 (PHP 4.x)
zend.ze1_compatibility_mode = Off

short_open_tag = Off

; Allow ASP-style <% %> tags.
asp_tags = Off

; The number of significant digits displayed in floating point numbers.
precision = 14

; Enforce year 2000 compliance (will cause problems with non-compliant browsers)
y2k_compliance = On

output_buffering = 4096

;output_handler =

zlib.output_compression = Off
;zlib.output_compression_level = -1


;zlib.output_handler =

implicit_flush = Off

unserialize_callback_func=

serialize_precision = 100

allow_call_time_pass_reference = Off

;
; Safe Mode
;
safe_mode = Off

safe_mode_gid = Off

safe_mode_include_dir =

safe_mode_exec_dir =

safe_mode_allowed_env_vars = PHP_

safe_mode_protected_env_vars = LD_LIBRARY_PATH

;open_basedir =

disable_functions =

disable_classes =

;highlight.string = #DD0000
;highlight.comment = #FF9900
;highlight.keyword = #007700
;highlight.bg = #FFFFFF
;highlight.default = #0000BB
;highlight.html = #000000

; ignore_user_abort = On

; realpath_cache_size=16k

; realpath_cache_ttl=120

expose_php = On


;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;

max_execution_time = 30 ; Maximum execution time of each script, in seconds
max_input_time = 60 ; Maximum amount of time each script may spend parsing request data
memory_limit = 128M ; Maximum amount of memory a script may consume (128MB)


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Error handling and logging ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
error_reporting = E_ALL

display_errors = Off

display_startup_errors = Off

log_errors = On

log_errors_max_len = 1024
ignore_repeated_errors = Off

ignore_repeated_source = Off

report_memleaks = On

;report_zend_debug = 0

; Store the last error/warning message in $php_errormsg (boolean).
track_errors = Off

;html_errors = Off

;docref_root = "/phpmanual/"
;docref_ext = .html

; String to output before an error message.
;error_prepend_string = "<font color=ff0000>"

; String to output after an error message.
;error_append_string = "</font>"

; Log errors to specified file.
;error_log = filename

; Log errors to syslog (Event Log on NT, not valid in Windows 95).
;error_log = syslog


;;;;;;;;;;;;;;;;;
; Data Handling ;
;;;;;;;;;;;;;;;;;

; The separator used in PHP generated URLs to separate arguments.
; Default is "&".
;arg_separator.output = "&"

;arg_separator.input = ";&"

variables_order = "GPCS"

register_globals = Off
register_long_arrays = Off

register_argc_argv = Off

auto_globals_jit = On

; Maximum size of POST data that PHP will accept.
post_max_size = 8M

; Magic quotes
;

; Magic quotes for incoming GET/POST/Cookie data.
magic_quotes_gpc = Off

; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.
magic_quotes_runtime = Off

; Use Sybase-style magic quotes (escape ' with '' instead of \').
magic_quotes_sybase = Off

; Automatically add files before or after any PHP document.
auto_prepend_file =
auto_append_file =

; As of 4.0b4, PHP always outputs a character encoding by default in
; the Content-type: header. To disable sending of the charset, simply
; set it to be empty.
;
; PHP's built-in default is text/html
default_mimetype = "text/html"
;default_charset = "iso-8859-1"

; Always populate the $HTTP_RAW_POST_DATA variable.
;always_populate_raw_post_data = On


;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;

; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"

doc_root =

; The directory under which PHP opens the script using /~username used only
; if nonempty.
user_dir =

; Directory in which the loadable extensions (modules) reside.
extension_dir = "./ext"

enable_dl = On

; cgi.force_redirect = 1

; if cgi.nph is enabled it will force cgi to always sent Status: 200 with
; every request.
; cgi.nph = 1

; cgi.redirect_status_env = ;

; fastcgi.impersonate = 1;

; Disable logging through FastCGI connection
; fastcgi.log = 0

;cgi.rfc2616_headers = 0


;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;

; Whether to allow HTTP file uploads.
file_uploads = On

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
;upload_tmp_dir =

; Maximum allowed size for uploaded files.
upload_max_filesize = 2M


;;;;;;;;;;;;;;;;;;
; Fopen wrappers ;
;;;;;;;;;;;;;;;;;;

; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
allow_url_fopen = On

; Whether to allow include/require to open URLs (like http:// or ftp://) as files.
allow_url_include = Off

; Define the anonymous ftp password (your email address)
;from="john@doe.com"

; Define the User-Agent string
; user_agent="PHP"

; Default timeout for socket based streams (seconds)
default_socket_timeout = 60
upload_tmp_dir="C:\DOCUME~1\SULLIV~1\LOCALS~1\Temp\php\upload"
session.save_path="C:\DOCUME~1\SULLIV~1\LOCALS~1\Temp\php\session"

; auto_detect_line_endings = Off


;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
;extension=php_bz2.dll
;extension=php_curl.dll
;extension=php_dba.dll
;extension=php_dbase.dll
;extension=php_exif.dll
;extension=php_fdf.dll
;extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_ifx.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
;extension=php_mbstring.dll
;extension=php_mcrypt.dll
;extension=php_mhash.dll
;extension=php_mime_magic.dll
;extension=php_ming.dll
;extension=php_msql.dll
;extension=php_mssql.dll
;extension=php_mysql.dll
;extension=php_mysqli.dll
;extension=php_oci8.dll
;extension=php_openssl.dll
;extension=php_pdo.dll
;extension=php_pdo_firebird.dll
;extension=php_pdo_mssql.dll
;extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_oci8.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
;extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_pspell.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
;extension=php_soap.dll
;extension=php_sockets.dll
;extension=php_sqlite.dll
;extension=php_sybase_ct.dll
;extension=php_tidy.dll
;extension=php_xmlrpc.dll
extension=php_xsl.dll
extension=php_xslt.dll
;extension=php_zip.dll

;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;

[Date]
; Defines the default timezone used by the date functions
;date.timezone =

;date.default_latitude = 31.7667
;date.default_longitude = 35.2333

;date.sunrise_zenith = 90.583333
;date.sunset_zenith = 90.583333

[filter]
;filter.default = unsafe_raw
;filter.default_flags =

[iconv]
;iconv.input_encoding = ISO-8859-1
;iconv.internal_encoding = ISO-8859-1
;iconv.output_encoding = ISO-8859-1

[sqlite]
;sqlite.assoc_case = 0

[xmlrpc]
;xmlrpc_error_number = 0
;xmlrpc_errors = 0

[Pcre]
;PCRE library backtracking limit.
;pcre.backtrack_limit=100000

;PCRE library recursion limit.
;pcre.recursion_limit=100000

[Syslog]
define_syslog_variables = Off

[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25

; For Win32 only.
;sendmail_from = me@example.com

; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =

;mail.force_extra_parameters =

[SQL]
sql.safe_mode = Off

[ODBC]
;odbc.default_db = Not yet implemented
;odbc.default_user = Not yet implemented
;odbc.default_pw = Not yet implemented

; Allow or prevent persistent links.
odbc.allow_persistent = On

; Check that a connection is still valid before reuse.
odbc.check_persistent = On

; Maximum number of persistent links. -1 means no limit.
odbc.max_persistent = -1

; Maximum number of links (persistent + non-persistent). -1 means no limit.
odbc.max_links = -1

odbc.defaultlrl = 4096

odbc.defaultbinmode = 1

Code: Select all

; Allow or prevent persistent links.
mysql.allow_persistent = On

; Maximum number of persistent links.  -1 means no limit.
mysql.max_persistent = -1

; Maximum number of links (persistent + non-persistent).  -1 means no limit.
mysql.max_links = -1

mysql.default_port =

; Default socket name for local MySQL connects.  If empty, uses the built-in
; MySQL defaults.
mysql.default_socket =

; Default host for mysql_connect() (doesn't apply in safe mode).
mysql.default_host =

; Default user for mysql_connect() (doesn't apply in safe mode).
mysql.default_user =

mysql.default_password =

; Maximum time (in seconds) for connect timeout. -1 means no limit
mysql.connect_timeout = 60

mysql.trace_mode = Off

[MySQLi]

; Maximum number of links.  -1 means no limit.
mysqli.max_links = -1

mysqli.default_port = 3306

; Default socket name for local MySQL connects.  If empty, uses the built-in
; MySQL defaults.
mysqli.default_socket =

; Default host for mysql_connect() (doesn't apply in safe mode).
mysqli.default_host =

; Default user for mysql_connect() (doesn't apply in safe mode).
mysqli.default_user =

mysqli.default_pw =

; Allow or prevent reconnect
mysqli.reconnect = Off

[mSQL]
; Allow or prevent persistent links.
msql.allow_persistent = On

; Maximum number of persistent links.  -1 means no limit.
msql.max_persistent = -1

; Maximum number of links (persistent+non persistent).  -1 means no limit.
msql.max_links = -1

[OCI8]
; enables privileged connections using external credentials (OCI_SYSOPER, OCI_SYSDBA)
;oci8.privileged_connect = Off

; Connection: The maximum number of persistent OCI8 connections per
; process. Using -1 means no limit.
;oci8.max_persistent = -1

;oci8.persistent_timeout = -1

;oci8.ping_interval = 60

;oci8.statement_cache_size = 20

;oci8.default_prefetch = 10

;oci8.old_oci_close_semantics = Off

[PostgresSQL]
; Allow or prevent persistent links.
pgsql.allow_persistent = On

; Detect broken persistent links always with pg_pconnect().
; Auto reset feature requires a little overheads.
pgsql.auto_reset_persistent = Off

; Maximum number of persistent links.  -1 means no limit.
pgsql.max_persistent = -1

; Maximum number of links (persistent+non persistent).  -1 means no limit.
pgsql.max_links = -1

; Ignore PostgreSQL backends Notice message or not.
; Notice message logging require a little overheads.
pgsql.ignore_notice = 0

; Log PostgreSQL backends Noitce message or not.
; Unless pgsql.ignore_notice=0, module cannot log notice message.
pgsql.log_notice = 0

[Sybase]
; Allow or prevent persistent links.
sybase.allow_persistent = On

; Maximum number of persistent links.  -1 means no limit.
sybase.max_persistent = -1

; Maximum number of links (persistent + non-persistent).  -1 means no limit.
sybase.max_links = -1

;sybase.interface_file = "/usr/sybase/interfaces"

; Minimum error severity to display.
sybase.min_error_severity = 10

; Minimum message severity to display.
sybase.min_message_severity = 10

sybase.compatability_mode = Off

[Sybase-CT]
; Allow or prevent persistent links.
sybct.allow_persistent = On

; Maximum number of persistent links.  -1 means no limit.
sybct.max_persistent = -1

; Maximum number of links (persistent + non-persistent).  -1 means no limit.
sybct.max_links = -1

; Minimum server message severity to display.
sybct.min_server_severity = 10

; Minimum client message severity to display.
sybct.min_client_severity = 10

[bcmath]
; Number of decimal digits for all bcmath functions.
bcmath.scale = 0

[browscap]
;browscap = extra/browscap.ini

[Informix]
; Default host for ifx_connect() (doesn't apply in safe mode).
ifx.default_host =

; Default user for ifx_connect() (doesn't apply in safe mode).
ifx.default_user =

; Default password for ifx_connect() (doesn't apply in safe mode).
ifx.default_password =

; Allow or prevent persistent links.
ifx.allow_persistent = On

; Maximum number of persistent links.  -1 means no limit.
ifx.max_persistent = -1

; Maximum number of links (persistent + non-persistent).  -1 means no limit.
ifx.max_links = -1

; If on, select statements return the contents of a text blob instead of its id.
ifx.textasvarchar = 0

; If on, select statements return the contents of a byte blob instead of its id.
ifx.byteasvarchar = 0

; Trailing blanks are stripped from fixed-length char columns.  May help the
; life of Informix SE users.
ifx.charasvarchar = 0

; If on, the contents of text and byte blobs are dumped to a file instead of
; keeping them in memory.
ifx.blobinfile = 0

; NULL's are returned as empty strings, unless this is set to 1.  In that case,
; NULL's are returned as string 'NULL'.
ifx.nullformat = 0

[Session]
; Handler used to store/retrieve data.
session.save_handler = files

;session.save_path = "/tmp"

; Whether to use cookies.
session.use_cookies = 1

;session.cookie_secure =

; session.use_only_cookies = 1

; Name of the session (used as cookie name).
session.name = PHPSESSID

; Initialize session on request startup.
session.auto_start = 0

; Lifetime in seconds of cookie or, if 0, until browser is restarted.
session.cookie_lifetime = 0

; The path for which the cookie is valid.
session.cookie_path = /

; The domain for which the cookie is valid.
session.cookie_domain =

; Whether or not to add the httpOnly flag to the cookie, which makes it inaccessible to browser scripting languages such as JavaScript.
session.cookie_httponly = 

; Handler used to serialize data.  php is the standard serializer of PHP.
session.serialize_handler = php

; Define the probability that the 'garbage collection' process is started
; on every session initialization.
; The probability is calculated by using gc_probability/gc_divisor,
; e.g. 1/100 means there is a 1% chance that the GC process starts
; on each request.

session.gc_probability = 1
session.gc_divisor     = 1000

session.bug_compat_42 = 0
session.bug_compat_warn = 1
session.referer_check =

; How many bytes to read from the file.
session.entropy_length = 0

; Specified here to create the session id.
session.entropy_file =

;session.entropy_length = 16

;session.entropy_file = /dev/urandom

session.cache_limiter = nocache

; Document expires after n minutes.
session.cache_expire = 180

session.use_trans_sid = 0

session.hash_function = 0

session.hash_bits_per_character = 5

[MSSQL]
; Allow or prevent persistent links.
mssql.allow_persistent = On

; Maximum number of persistent links.  -1 means no limit.
mssql.max_persistent = -1

; Maximum number of links (persistent+non persistent).  -1 means no limit.
mssql.max_links = -1

; Minimum error severity to display.
mssql.min_error_severity = 10

; Minimum message severity to display.
mssql.min_message_severity = 10

; Compatibility mode with old versions of PHP 3.0.
mssql.compatability_mode = Off

; Connect timeout
;mssql.connect_timeout = 5

; Query timeout
;mssql.timeout = 60

; Valid range 0 - 2147483647.  Default = 4096.
;mssql.textlimit = 4096

; Valid range 0 - 2147483647.  Default = 4096.
;mssql.textsize = 4096

; Limits the number of records in each batch.  0 = all records in one batch.
;mssql.batchsize = 0

;mssql.datetimeconvert = On

; Use NT authentication when connecting to the server
mssql.secure_connection = Off

; Specify max number of processes. -1 = library default
; msdlib defaults to 25
; FreeTDS defaults to 4096
;mssql.max_procs = -1

; Specify client character set. 
; If empty or not set the client charset from freetds.comf is used
; This is only used when compiled with FreeTDS
;mssql.charset = "ISO-8859-1"

[Assertion]
; Assert(expr); active by default.
;assert.active = On

; Issue a PHP warning for each failed assertion.
;assert.warning = On

; Don't bail out by default.
;assert.bail = Off

; User-function to be called if an assertion fails.
;assert.callback = 0

; Eval the expression with current error_reporting().  Set to true if you want
; error_reporting(0) around the eval().
;assert.quiet_eval = 0

[COM]
; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs
;com.typelib_file =
; allow Distributed-COM calls
;com.allow_dcom = true
; autoregister constants of a components typlib on com_load()
;com.autoregister_typelib = true
; register constants casesensitive
;com.autoregister_casesensitive = false
; show warnings on duplicate constant registrations
;com.autoregister_verbose = true

[mbstring]
;mbstring.language = Japanese

;mbstring.internal_encoding = EUC-JP

; http input encoding.
;mbstring.http_input = auto

;mbstring.http_output = SJIS

;mbstring.encoding_translation = Off

; automatic encoding detection order.
; auto means
;mbstring.detect_order = auto

;mbstring.substitute_character = none;

;mbstring.func_overload = 0

; enable strict encoding detection.
;mbstring.strict_encoding = Off

[FrontBase]
;fbsql.allow_persistent = On
;fbsql.autocommit = On
;fbsql.show_timestamp_decimals = Off
;fbsql.default_database =
;fbsql.default_database_password =
;fbsql.default_host =
;fbsql.default_password =
;fbsql.default_user = "_SYSTEM"
;fbsql.generate_warnings = Off
;fbsql.max_connections = 128
;fbsql.max_links = 128
;fbsql.max_persistent = -1
;fbsql.max_results = 128

[gd]
; Tell the jpeg decode to libjpeg warnings and try to create
; a gd image. The warning will then be displayed as notices
; disabled by default
;gd.jpeg_ignore_warning = 0

[exif]
; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS.

[Tidy]
tidy.clean_output = Off
[soap]
soap.wsdl_cache_enabled=1
soap.wsdl_cache_dir="/tmp"
soap.wsdl_cache_ttl=86400
; tab-width: 4
; End:
[/quote]

Posted: Tue May 22, 2007 7:26 am
by feyd
You shouldn't have needed to change a single line in volka's posted snippet.

Posted: Tue May 22, 2007 7:50 am
by sullivans
My mistake, here's the output:
php.ini: C:\WINDOWS\php.ini
version: 5.2.2
sapi: apache2handler
; extension=php_xslt.dll
extension=php_xsl.dll
extension=php_xslt.dll
I wonder why extension=php_xslt.dll shows up twice?

*EDIT: I just ran a php -m from the command line and I get these two errors:
PHP Warning: PHP Startup: Unable to load dynamic library './ext\php_xsl.dll' - The specified procedure could not be found.
in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library './ext\php_xslt.dll - The specified module could not be found.
in Unknown on line 0
So it looks like php can't find those two dlls even though their both in C:\WINDOWS and C:\Program Files\PHP\ext. My extension_dir is set to C:\Program Files\PHP\ext so i'm not sure what's going on here.

Posted: Tue May 22, 2007 8:33 am
by sullivans
Well I re-downloaded the latest release of php and re-copied those dll's and for some reason now it seems to be working (no errors when I do php -m). Also on the phpinfo() page xsl and libxslt is finally showing up.

But for some reason I still get nothing but a blank white screen when I try and run those scripts I posted above...This is rather frustrating. Can someone else please try and run those three scripts and tell me if you get any output? At least then I'll know if the problem is with the code or some configuration problem thanks.

Posted: Tue May 22, 2007 1:47 pm
by volka
Where did you get this php_xslt.dll ?

Posted: Tue May 22, 2007 2:03 pm
by sullivans
Well I think i figured out what the problem was. Apparently in PHP5 they got rid of xslt_create() and I have to use the XSL module instead. I figured this out by checking my log file and saw these errors:
[22-May-2007 14:44:08] PHP Fatal error: Call to undefined function xslt_create() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\order.php on line 5

[22-May-2007 14:44:23] PHP Fatal error: Call to undefined function xslt_create() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\phpTests\index.php on line 64
So basically I have to either rewrite a large amount of crap or go back to PHP 4.x ... yeah

Well thanks for the help.

*EDIT: I found a cool wrapper script for the old xslt_create() function in php5. I'll post it here in case someone else finds it useful.

Code: Select all

<?

if (PHP_VERSION >= 5) {
    // Emulate the old xslt library functions
    function xslt_create() {
        return new XsltProcessor();
    }

    function xslt_process($xsltproc,
                          $xml_arg,
                          $xsl_arg,
                          $xslcontainer = null,
                          $args = null,
                          $params = null) {
        // Start with preparing the arguments
        $xml_arg = str_replace('arg:', '', $xml_arg);
        $xsl_arg = str_replace('arg:', '', $xsl_arg);

        // Create instances of the DomDocument class
        $xml = new DomDocument;
        $xsl = new DomDocument;

        // Load the xml document and the xsl template
        $xml->loadXML($args[$xml_arg]);
        $xsl->loadXML($args[$xsl_arg]);

        // Load the xsl template
        $xsltproc->importStyleSheet($xsl);

        // Set parameters when defined
        if ($params) {
            foreach ($params as $param => $value) {
                $xsltproc->setParameter("", $param, $value);
            }
        }

        // Start the transformation
        $processed = $xsltproc->transformToXML($xml);

        // Put the result in a file when specified
        if ($xslcontainer) {
            return @file_put_contents($xslcontainer, $processed);
        } else {
            return $processed;
        }

    }

    function xslt_free($xsltproc) {
        unset($xsltproc);
    }
}

$arguments = array(
    '/_xml' => file_get_contents("newxslt.xml"),
    '/_xsl' => file_get_contents("newxslt.xslt")
);

$xsltproc = xslt_create();
$html = xslt_process(
    $xsltproc,
    'arg:/_xml',
    'arg:/_xsl',
    null,
    $arguments
);

xslt_free($xsltproc);
print $html;

?>