Jump to content

php/mysql error?


sfareri

Recommended Posts

I'm running win XP, php5, apache web server.  Everytime I try and load the php page I can always see the code in my web page. any ideas? everything seems to be setup.  all the errors in the apache error log show each line is in the connect() part of the script.  please help!! I'm willing to send/email for help.

Thanks,
Sam.
Link to comment
Share on other sites

Ok, here you go.. but now... apache does not want to start when windows starts.  sometimes it starts, sometimes it does not.. maybe I need to uninstall zonealarm pro? I have all the setting to let me use it.. maybe that is my issue? althought when I turn it off does the same thing.. maybe thats my sql errors? who knows.

Link to comment
Share on other sites

Put your php.ini and httpd.conf into a zip/rar file and attach it to your post (click the reply button and then expand the [b]+ Additional Options...[/b] by clicking it. Now click the browse button and find your zip/rar file and click post when done).

Also by any chance do the errors look like this:
[b]Fatal error: Call to undefined function mysql_connect() in [path of script here] on line [line number here][/b]

if they do then you havn't enabled the MySQL extension in the php.ini, [url=http://www.phpfreaks.com/forums/index.php/topic,95378.0.html]this FAQ Thread[/url] should help you enable the extension. Also it would be a good idea to enable the [b]display_startup_errors[/b] directive in the php.ini, that way you if PHP is having trouble stating up it will display an error window on startup.
Link to comment
Share on other sites

Looking at your php.ini you have not setup the [b]extension_dir[/b] directive (located on line 520) .

Change:
[code]extension_dir = "./"[/code]

to:
[code]extension_dir = "C:/PHP/ext"[/code]

Also turn on the following directives too:
[b]display_errors[/b]  (line 356)
[b]display_startup_errors[/b] (line 361)

Save php.ini and restart Apache.

If PHP is having trouble loading up, they should popup when Apache is starting up.

Also make sure your PHP folder is added to the Windows PATH variable too.

To add the PHP folder to the Windows PATH variable, make sure you're logged in as the administrator account. Now go to Start > Control Panel > System > Advanced Tab > Environment Variables button > Environment Variables Box

Scroll to the Path variable. Left click the Path variable row and click the edit button. Now press the End key on your keyboard type in the following exactly: ;C:\PHP; Click Ok on the three open dialog boxes to close them. Restart Windows. if you don't restart Windows then new Path variable wont come available until you do.
Link to comment
Share on other sites

And did it solve any problems? or are you now getting problems with Apache? If you are then reset the httpd.conf by copying httpd.conf from the default folder (C:/Program Files/Apache Software Foundation/Apache2.2/conf/default/) to the conf folder overwriting the existing http.conf file

Now restart Apache. It should load up now. However without PHP support as we got rid of that.

Is Apache now loaded up?
Link to comment
Share on other sites

I have apache working again.  I uninstalled everything and started over.  Now, its up and running.  But the sql codes are showing on the web pages.  something must be wrong.  I can load the php sites local and they are fine.  The stupid thing keeps showing the sql code mixed in the web pages on the php files.  any ideas?  I did everything else I was asked to do.  Now what do I do?
Link to comment
Share on other sites

well the join page gives me this error for example from the main screen

updated<=$month_start){ $sql_query="update stats set month_sgnin='0', month_vis='0', updated='$now'"; sql_execute($sql_query,''); } if($stats->updated<=$week_start){ $sql_query="update stats set week_sgnin='0', week_vis='0', updated='$now'"; sql_execute($sql_query,''); } if($stats->updated<=$day_start){ $sql_query="update stats set day_sgnin='0', day_vis='0', vis='', updated='$now'"; sql_execute($sql_query,''); } $day=24*3600; if($now-$visit>=$day){ $sql_query="update stats set day_vis=day_vis+1,week_vis=week_vis+1,month_vis=month_vis+1, vis=concat(vis,'|$now')"; sql_execute($sql_query,''); SetCookie("visit",$now,time()+60*60*24,"/",$cookie_url); }//if check($mode); ?>
Link to comment
Share on other sites

That is PHP code. Looks like there is an unclosed quote in an echo/print statement which is showing the PHP code. Could you post the full code here for where the above code came from and I'll have a look. Dont post as text here attach it as a file attachment.

To do so Click Reply button and then click the Additional Options... link. Now attach the PHP file to the post by clicking the browse button and selecting the php file from the explorer window that opens.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.