WebFaction
Community site: login faq

I have web321 server. I want to use mysql_pconnect connection string for my mysql database. If increasing number of connections is not possible it's okey for me but i need persistent mysql conection. Can i do so?

Thanks in advance.

asked 17 Oct '12, 07:17

Vish
11
accept rate: 0%


Hi,

Yes, persistent connections are allowed.

permanent link

answered 17 Oct '12, 07:54

todork
1.2k5
accept rate: 34%

First of all thanks a lot for your reply. I am not able to use persistent connection. The table that i am using is a temporary table and table type is MEMORY. When the page loads i create a table using statement CREATE TEMPORARY TABLE

[columns]) ENGINE = MEMORY or MYISAM. It works fine first time when the page loads but when i try to query same table through ajax on button click i get mysql error 'table<xyz> dosen't exist'. I believe it is related to mysql connection because it breaks?? or it is something related to PHP?

Your help will be greatly appreciated.

Regards.

(17 Oct '12, 10:05) Vish

If you're using PHP with the shared Apache instance, this probably won't work since PHP is working as CGI. With CGI, every new request is launched in its own process, so the information from the previous request (process) is destroyed.

In other words, using persistent connections over CGI is pointless, as those connections don't actually persist. If you want to use PHP with persistent connections, you would have to install your own web server (for example, Apache with mod_php) and use that instead of the shared Apache.

(17 Oct '12, 10:12) todork

That make sense. So should i ask webfaction if they can have apache module enabled for my account? Is it possible to do it per connection basis? Thanks for your help.

(18 Oct '12, 03:51) Vish

Sorry, we don't have PHP as an Apache module running on the shared Apache instance. You'd have to build your own Apache for this.

(18 Oct '12, 04:34) todork

Okey i got it. Please tell me if it will be a long and hard process to build apache from the source on webfaction server? will i have to build php5 and mysql from the source and connect them to apache again with all the configuration options for each libraries? What other libraries will i have to install with apache? Currently I have two websites on webfaction server, will this change affact all of them? i just want apache with mode_php for only one website & not for other. Can you please provide me any doc how to do this or any help?

It seems to be long process!!!

(18 Oct '12, 05:27) Vish

Hi again,

Actually, you might be able to use the Apache server that is already installed, and just build mod_php in your account. You can then start the server using "/usr/sbin/httpd -f ~/httpd.conf" to specify your own config file for the Apache server. It is not a very straightforward process, so if you run into any troubles, feel free to open a ticket at our support site.

(18 Oct '12, 05:31) todork
showing 5 of 6 show 1 more comments
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×168
×14
×1
×1

question asked: 17 Oct '12, 07:17

question was seen: 2,387 times

last updated: 18 Oct '12, 05:31

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2020 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM