php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44349 Parse error with installer generated php.ini
Submitted: 2008-03-06 04:19 UTC Modified: 2008-08-22 18:23 UTC
From: jcs at austin dot rr dot com Assigned: jmertic (profile)
Status: Closed Package: Windows Installer
PHP Version: 5.2.5 OS: Windows XP
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jcs at austin dot rr dot com
New email:
PHP Version: OS:

 

 [2008-03-06 04:19 UTC] jcs at austin dot rr dot com
Description:
------------
Hi,

I am having a hard time getting PHP to read the phi.ini file which
I want to enable MySQL extensions with. If I run phpinfo(), I see it
is lookong in C:\WINDOWS for the file but there is no loaded file.
Copying the php.ini file to C:\WINDOWS does not help.

OK:

PHP installed to:

1) C:\PHP
2) extensions in:

   C:\PHP\ext

3) php.ini file in C:\PHP

   This was the installer generated file.

4) In a command window at the command line in C:\PHP

   I run php -c . php.ini

I get the following:

PHP Parse error: syntax error, unexpected T_LOGICAL_AND in C:\PHP\php.ini on line 126

The line is just a comment...I don't get it (see below).

; NOTE: Using short tags should be avoided when developing applications or


Please help, I have wasted so much time on this.

I think the loading of the php.ini is failing which is why
my extensions don't work.

Regards.



Reproduce code:
---------------
;     since short tags may not be supported on the target server.

;;;;;;;;;;;;;;;;;;;;
; Language Options ;
;;;;;;;;;;;;;;;;;;;;

; 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

; Allow the <? tag.  Otherwise, only <?php and <script> tags are recognized.

; NOTE: Using short tags should be avoided when developing applications or
; libraries that are meant for redistribution, or deployment on PHP
; servers which are not under your control, because short tags may not
; be supported on the target server. For portable, redistributable code,
; be sure not to use short tags.
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 allows you to send header lines (including cookies) even


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-03-07 06:10 UTC] jcs at austin dot rr dot com
OK,

SOME PROGRESS:

1) I THINK THE ERROR THAT WAS GIVEN WAS BOGUS...THERE ARE MANY
POSTS ON THE WEB THAT SHOW PARSE ERRORS TO LINES THAT DON'T EXIST
IN PHI.INI FILES

2) GOT IT TO WORK BY:

- COPYING THE ZIP INSTALL TO THE C:\PHP DIRECTORY.

   problem: could not figure out how to "tell" windows that
   PHP was there so every time I loaded a page it didn't know
   how to interpret a .php file.

so:

- WITHOUT ERASING, WROTE OVER THIS WITH THE INSTALL VERSION.
  this configured windows correctly but left the correct
  "configuration" in place.

3) in my opinion the installer is buggy.

4) The ZIP version is OK but maybe you should make it more
   clear to folks how to "hook" into Windows.

5) Why not have "pay as you go" tech support for install problems.

   I would have very happily PayPal-ed you guys $100 bucks to help 
   me through this...it has been several nights to figure this out
   and read through all the postings out there. 

I STILL DON'T KNOW WHY IT WORKED OR WHAT WAS WRONG BUT I WILL TAKE
THE WIN FOR NOW.

Regards.
 [2008-03-08 22:29 UTC] johannes@php.net
Assigned to installer maintainer
 [2008-03-12 13:37 UTC] jmertic@php.net
If you add the PHPRC enviroment variable set to the directory where php is installed, it should work fine.

This has been re-added in CVS.

Also, the command you want to use to specific using a particular php.ini file is:

php.exe -c <directory of php.ini file> <filename>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 17:01:58 2024 UTC