[SOLVED] PHP code is not run but attempting to download file
noahwallach
Joined: 2005-04-26
Posts: 94 |
![]() |
I am attempting to fix a friend's installation of gallery2. When I goto the URL http://hostname/gallery/upgrade/index.php the file is wanted to be downloaded instead of being run as a php file. what do I need to fix here? Cheers, noah |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
that's usually a symptom of a php error. check out the apache error logs. |
|
noahwallach
Joined: 2005-04-26
Posts: 94 |
![]() |
thanks for your response. it is a virtual host and nothing is appearing in the relevant virtual host error logs. what else can I check? |
|
noahwallach
Joined: 2005-04-26
Posts: 94 |
![]() |
just a follow up when I go to the http://domain.com/gallery page. I see the following in the access_log for the particular domain. ----- snip ------ 66.IP - - [27/Sep/2006:08:46:15 -0700] "GET /gallery HTTP/1.1" 301 369 "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7" ---- snip --- nothing appears in the error log |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
the above log shows nothing for the /gallery/upgrade/index.php |
|
noahwallach
Joined: 2005-04-26
Posts: 94 |
![]() |
yeah that is peculiar. so what does that mean? there is nothing in the relevant error log. what else could show me whats going on? cheers, Noah |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
please post a phpinfo link. |
|
noahwallach
Joined: 2005-04-26
Posts: 94 |
![]() |
the phpinfo.php page wants to be downloaded and is not executable from the browser. memory_limit = 128M ; Maximum amount of memory a script may consume (8MB) what else could I check? Cheers, Noah |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
are you sure php works on that box? please post a link to the phpinfo file. |
|
noahwallach
Joined: 2005-04-26
Posts: 94 |
![]() |
Hi valiant, php is working fine. gallery is working fine under other virtual hosts. http://www.vaporvent.com/gallery/setup/phpinfo.php cheers, Noah |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
not on this one... check with your webhost about this issue. |
|
noahwallach
Joined: 2005-04-26
Posts: 94 |
![]() |
I am the admin of the box. I will try the php script. cheers, Noah |
|
noahwallach
Joined: 2005-04-26
Posts: 94 |
![]() |
check the php info page out now. http://www.vaporvent.com/gallery/phpinfo.php but still the install/index.php wants to be downloaded. |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
set then restart apache and check again. |
|
noahwallach
Joined: 2005-04-26
Posts: 94 |
![]() |
okay done |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
please ensure that php logs to your apache error log or specify a log file and then check if really no errors are logged. |
|
noahwallach
Joined: 2005-04-26
Posts: 94 |
![]() |
how can I insure my php logs to my apache error log? or how do I specify a log file? looks like they are cufrrently ending up in /var/log/messages Cheers, Noah |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
error_log in php.ini well, as long as you know where it's logged, that's fine. is there no php error logged in /var/log/messages ? |
|
noahwallach
Joined: 2005-04-26
Posts: 94 |
![]() |
no php errors so I dont know what is going on . Sep 28 10:53:36 httpd: PHP Warning: Function registration failed - duplicate name - session_name in Unknown on line 0 |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
what about using the last stable release of apache instead of the current stable / new release? |
|
noahwallach
Joined: 2005-04-26
Posts: 94 |
![]() |
any clues what the last stable release of apache is/was? cehers, Noah |
|
noahwallach
Joined: 2005-04-26
Posts: 94 |
![]() |
I upgraded to php5-5.1.6 and see the following errors: Sep 28 11:17:33 typhoon httpd: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20050922/fileinfo.so' - Cannot open "/usr/local/lib/php/20050922/fileinfo.so" in Unknown on line 0 |
|
noahwallach
Joined: 2005-04-26
Posts: 94 |
![]() |
now when I try to go to the main page of a working gallery. I see the folllowing: Sep 28 11:18:21 httpd: PHP Fatal error: Call to undefined function preg_match() in /a/www/data/www.domain.com/gallery/index.php on line 38 |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
i no longer can access your phpinfo. @preg_match: |
|
noahwallach
Joined: 2005-04-26
Posts: 94 |
![]() |
now I am trying to upgrade gallery to gallery2 I am getting hte following error Fatal error: Call to undefined function session_name() in /a/www/data/www.enabled.com/gallery/upgrade/index.php on line 74 I am runnning a portupgrade -Rr php5-5.1.6 |
|
noahwallach
Joined: 2005-04-26
Posts: 94 |
![]() |
how do I ensure PHP is compiled with PCRE regular expression. |
|
noahwallach
Joined: 2005-04-26
Posts: 94 |
![]() |
here are the PHP options I chose. lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk |
|
noahwallach
Joined: 2005-04-26
Posts: 94 |
![]() |
the phpinfo URL is working again |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
you need php with pcre, the session extension, ... |
|
noahwallach
Joined: 2005-04-26
Posts: 94 |
![]() |
okay I figured out how to do that. Iam going ot add those extentions to php5 |
|
noahwallach
Joined: 2005-04-26
Posts: 94 |
![]() |
okay gallery is still complaining and not seeing that php5-session is installed. Fatal error: Call to undefined function session_name() in /a/www/data/www.domain.com/gallery/upgrade/index.php on line 74 pkg_info # pkg_info | grep php |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
edit php.ini these are shared extensions (.so files), you need to enable them in php.ini and then you need to restart php. |
|
noahwallach
Joined: 2005-04-26
Posts: 94 |
![]() |
okay this is working now - thank you |
|