Re: [PHP] PDO

2012-10-22 Thread Lester Caine

Silvio Siefke wrote:

i found the mistake, i have forgetten write the new path for the sqlite
database.


Just been caught with a similar problem. Had moved a working site from windows 
to linux and it stopped serving up the swf files. Turns out the file has a 
hardcoded path with upper and lower case name, while the xml file was all lower 
case. Rename the folder with the right cases and it started working again :)


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PDO

2012-10-22 Thread Silvio Siefke
Hello,


i found the mistake, i have forgetten write the new path for the sqlite 
database.


Thx
Silvio

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PDO

2012-10-22 Thread Adam Richardson
On Mon, Oct 22, 2012 at 5:27 PM, Silvio Siefke  wrote:
> Hello,
>
> i have built php 5.4.7 on Ubuntu with the configure Arguments like on my
> Gentoo System. But on Gentoo run the website without Problems, under Ubuntu
> want not work. I become in error.log:
>
> [22-Oct-2012 21:15:00 UTC] PHP Fatal error:  Call to a member function
> prepare() on a non-object in html/index.html on line 23
>

Can you show the code in db.php (just remember to remove any login
credentials)? It looks like there's an issue creating the $db object
you're using.

Adam



-- 
Nephtali:  A simple, flexible, fast, and security-focused PHP framework
http://nephtaliproject.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PDO

2012-10-22 Thread Ashley Sheridan
On Mon, 2012-10-22 at 23:27 +0200, Silvio Siefke wrote:

> Hello,
> 
> i have built php 5.4.7 on Ubuntu with the configure Arguments like on my 
> Gentoo System. But on Gentoo run the website without Problems, under Ubuntu
> want not work. I become in error.log:
> 
> [22-Oct-2012 21:15:00 UTC] PHP Fatal error:  Call to a member function 
> prepare() on a non-object in html/index.html on line 23
> 
> U use PHP FPM with Nginx. 
> 
> The configure Arguments:
> http://pastebin.geany.org/qz8TP/
> 
> The Script which work:
>  require_once ("db.php");
> 
> $query = $db->prepare("SELECT id, title, date FROM bloggen ORDER BY date DESC 
> LIMIT 0,5");
> if (!$query) {die("Execute query error, because: " . $db->errorInfo());}
> 
> $query->execute();
> 
> while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
> echo " title=\"".(htmlentities($row['title'], ENT_QUOTES, 
> "UTF-8"))."\">".(htmlentities($row['title'], ENT_QUOTES, 
> "UTF-8"))."\n";
> }
> 
> $row = null;
> $query = null;
> $db = null;
> ?>
> 
> 
> Has someone a idea what is there wrong?
> 
> 
> Thanks for help and nice Day.
> 
> Silvio
> 


It's a bit odd that you're parsing all .html files as if they were PHP
(little bit of a waste, and does mean you'll have an extra step when
configuring a server to run the code)

That aside, I don't see 23 lines of code in your example, so I'm
assuming you've snipped a lot of the beginning (you've not mentioned in
particular which line in your excerpt is the 23rd). What's in your
db.php include? Are there any checks on whether a connection has been
established or not there?
-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] PDO

2012-10-22 Thread Nathan Nobbe
On Mon, Oct 22, 2012 at 3:27 PM, Silvio Siefke  wrote:

> Hello,
>
> i have built php 5.4.7 on Ubuntu with the configure Arguments like on my
> Gentoo System. But on Gentoo run the website without Problems, under Ubuntu
> want not work. I become in error.log:
>
> [22-Oct-2012 21:15:00 UTC] PHP Fatal error:  Call to a member function
> prepare() on a non-object in html/index.html on line 23
>
> U use PHP FPM with Nginx.
>
> The configure Arguments:
> http://pastebin.geany.org/qz8TP/
>
> The Script which work:
>  require_once ("db.php");
>
> $query = $db->prepare("SELECT id, title, date FROM bloggen ORDER BY date
> DESC LIMIT 0,5");
> if (!$query) {die("Execute query error, because: " . $db->errorInfo());}
>

That looks like you've not connected to the database successfully inside of
db.php.

-nathan


[PHP] PDO

2012-10-22 Thread Silvio Siefke
Hello,

i have built php 5.4.7 on Ubuntu with the configure Arguments like on my 
Gentoo System. But on Gentoo run the website without Problems, under Ubuntu
want not work. I become in error.log:

[22-Oct-2012 21:15:00 UTC] PHP Fatal error:  Call to a member function 
prepare() on a non-object in html/index.html on line 23

U use PHP FPM with Nginx. 

The configure Arguments:
http://pastebin.geany.org/qz8TP/

The Script which work:
prepare("SELECT id, title, date FROM bloggen ORDER BY date DESC 
LIMIT 0,5");
if (!$query) {die("Execute query error, because: " . $db->errorInfo());}

$query->execute();

while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
echo "".(htmlentities($row['title'], ENT_QUOTES, "UTF-8"))."\n";
}

$row = null;
$query = null;
$db = null;
?>


Has someone a idea what is there wrong?


Thanks for help and nice Day.

Silvio

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Missing email

2012-10-22 Thread Karl DeSaulniers

Strange, it did when I signed up and for a number of years after.


On Oct 22, 2012, at 10:09 AM, Gerardo Benitez wrote:


Hi Daniel,

I think that the robot that manage the list is not sending you your  
own emails.


Gerardo.

On Sat, Oct 20, 2012 at 10:38 AM, Daniel Brown   
wrote:
On Sat, Oct 20, 2012 at 5:00 AM, Karl DeSaulniers > wrote:

> @Moderator
> Any reason why my emails do not post or at least dont post for  
hours later?


There is no moderator on this list.  I'm probably about as close
as it comes.  Can you explain more about the problems you're
experiencing so that I can look into it further?

--

Network Infrastructure Manager
http://www.php.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
Gerardo Benitez
-
Programador Web Freelance



Karl DeSaulniers
Design Drumm
http://designdrumm.com



Re: [PHP] Wrong time being displayed by PHP!

2012-10-22 Thread Richard S. Crawford
On Thu, Oct 18, 2012 at 2:12 AM, Ford, Mike  wrote:

> > From: underp...@gmail.com [mailto:underp...@gmail.com] On Behalf Of
> > Richard S. Crawford
> > Sent: 17 October 2012 19:29
> > To: PHP-General
> >
> > You can see the current output of the above code here:
> >
> > http://projectbench.extensiondlc.net
>
> Can I ask what the fix for this was? Because that URL is currently
> showing the following for me:
>
> 02:09:27 am America/Los_Angeles
> America/Los_Angeles
> Thu, 18 Oct 2012 02:09:27 -0700
> Thu, 18 Oct 2012 09:09:27 +
> 1350551367 (-25200)
> Thu Oct 18 02:09:27 PDT 2012
>
>
> Cheers!
>
> Mike
>

Hi Mike,

Sorry I took so long to answer. I've been out sick, and didn't have access
to the resolution information until this morning.

The server administrators wound up reinstalling the tzdata package and
enabled time synchronization.



-- 
Sláinte,
Richard S. Crawford (rich...@underpope.com)
http://www.underpope.com
Publisher and Editor in Chief, Daikaijuzine (http://www.daikaijuzine.com)


Re: [PHP] Missing email

2012-10-22 Thread Gerardo Benitez
Hi Daniel,

I think that the robot that manage the list is not sending you your own
emails.

Gerardo.

On Sat, Oct 20, 2012 at 10:38 AM, Daniel Brown  wrote:

> On Sat, Oct 20, 2012 at 5:00 AM, Karl DeSaulniers 
> wrote:
> > @Moderator
> > Any reason why my emails do not post or at least dont post for hours
> later?
>
> There is no moderator on this list.  I'm probably about as close
> as it comes.  Can you explain more about the problems you're
> experiencing so that I can look into it further?
>
> --
> 
> Network Infrastructure Manager
> http://www.php.net/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Gerardo Benitez
-
Programador Web Freelance


Re: [PHP] Re: Recommendation request: Use Magento or build my own eCommerce?

2012-10-22 Thread Mark
On Mon, Oct 22, 2012 at 4:51 PM, Marc Guay  wrote:
> Why not just use the entire OpenCart package?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

Well, i was basing my choice of Magento on the "internet opinion" and
magento seems the most popular system out there to use with most of
the required extensions already there. OpenCart doesn't seem to be as
recommended as Magento..

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Recommendation request: Use Magento or build my own eCommerce?

2012-10-22 Thread Mark
On Mon, Oct 22, 2012 at 4:06 PM, Mark  wrote:
>
> Hi,
>
> I'm in a difficult situation here. I have a list of requirements for an 
> eCommerce system (Magento) where i'm getting mixed opinions about what to do. 
> Note: i do consider myself to be a quite experienced PHP programmer and 
> certainly have the skills to either make the extensions or make everything 
> from scratch. Both do require month of work! First - for the complete picture 
> - the list of requirements for the eCommerce system:
> - (buld into magento) Multishop has to be possible
> - Different payment modules have to be possible (buckaroo, afterpay, ...)
> - Online chat (with for example zopim) has to be possible
> - Advanced product permissions (magento only has "manage" not more specific 
> as in "edit")
> - Setting pruduct margins
> - Abandoned cart alerts
> - One page checkout
> - Some javascript/ajax things like "instant cart"
> - A very specific order page (the "Booking and Reservations" plugin can do 
> that)
>
> Thus far it's all oke. However, if i go to the magento irc channel i'm 
> getting really mixed opinions about what to use and what to create myself. 
> They basically say that i should prevent installing as much extensions as 
> possible and try to make most of the things myself. This is where i'm getting 
> really confused.
>
> There are two possible routes to take here.
> 1. I can go for the magento route and just take the very steep learning curve 
> it has. It will be a slow process to make the modules required (mainly the 
> advanced permissions, setting product margins and a abandoned cart 
> extension). Two of those three are very difficult to make. Certainly if you 
> consider that i'm just starting developing in any eCommerce system.
>
> 2. Considering the steep learning curve of making extensions for Magento it 
> might be easier - in the long run - to build it all myself. In the beginning 
> that will be an even slower process then using Magento, but once the 
> structure is build it will be a much faster development process for any 
> extension.
>
> I know it's usually a bad thing to reinvent the wheel and i am certainly not 
> intending that. However, right now i really get the impression that i'm 
> better of making it all myself. Both approaches take many months of 
> development where the self made version is going to pay off in development 
> time in the long run when compared to magento. I am just not sure what the 
> best solution might be.
>
> So here is a list of pros and cons that i can think of for both approaches.
>
> Pros/Cons for using magento
> - [pro] a lot of existing extensions
> - [pro] i don't need to worry about security updates since the come from 
> magento
> - [pro] living community around it to help out if there are any issues
> - [con] very steep learning curve
> - [con] not straightforward to start developing in
> - [con] takes a lot of time till you can even use the basics
>
> Pros/Cons for self made
> - [pro] Development will go a lot faster
> - [pro] i can make it more specific for one goal
> - [pro] a much easier extension model
> - [con] security all depends on me
> - [con] i have to make complicated extensions like buckaroo and afterpay 
> myself
> - [con] no existing library of extensions to use
>
> Again, i'm puzzled by this. If i follow the #magento (on freenode) list then 
> i should pick magento, but make every extension myself or only use the really 
> good ones. Thus that will require a lot of time to develop them. I 'm 
> guessing about half a year. Then again, if i make it all from the ground up 
> it's probably also going to take half a year to develop (or slightly more) 
> but it will obviously be much easier to maintain since i know every single 
> line of it.
>
> What is your recommendation? Build it myself? Use Magento? or another option 
> that i didn't even consider yet?
>
> Kind regards,
> Mark

Something i made up just now. Would it work if i make the ecommerce
system myself and build OpenCart support in it so that OpenCart
extensions can be installed in my oscommerce as well? Since then i
wouldn't have to bother about payment modules.

Though it does add a very complex translation layer from "my to be
build oscommerce" to the OpenCart system...

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Recommendation request: Use Magento or build my own eCommerce?

2012-10-22 Thread Marc Guay
Use Magento.  It will take you more than 6 months to build what you're
talking about all by yourself.  Magento is a pain to learn at first
but once you get into it things start to make sense and development
speeds up.

Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Recommendation request: Use Magento or build my own eCommerce?

2012-10-22 Thread Mark
Hi,

I'm in a difficult situation here. I have a list of requirements for an
eCommerce system (Magento) where i'm getting mixed opinions about what to
do. Note: i do consider myself to be a quite experienced PHP programmer and
certainly have the skills to either make the extensions or make everything
from scratch. Both do require month of work! First - for the complete
picture - the list of requirements for the eCommerce system:
- (buld into magento) Multishop has to be possible
- Different payment modules have to be possible (buckaroo, afterpay, ...)
- Online chat (with for example zopim) has to be possible
- Advanced product permissions (magento only has "manage" not more specific
as in "edit")
- Setting pruduct margins
- Abandoned cart alerts
- One page checkout
- Some javascript/ajax things like "instant cart"
- A very specific order page (the "Booking and Reservations" plugin can do
that)

Thus far it's all oke. However, if i go to the magento irc channel i'm
getting really mixed opinions about what to use and what to create myself.
They basically say that i should prevent installing as much extensions as
possible and try to make most of the things myself. This is where i'm
getting really confused.

There are two possible routes to take here.
1. I can go for the magento route and just take the very steep learning
curve it has. It will be a slow process to make the modules required
(mainly the advanced permissions, setting product margins and a abandoned
cart extension). Two of those three are very difficult to make. Certainly
if you consider that i'm just starting developing in any eCommerce system.

2. Considering the steep learning curve of making extensions for Magento it
might be easier - in the long run - to build it all myself. In the
beginning that will be an even slower process then using Magento, but once
the structure is build it will be a much faster development process for any
extension.

I know it's usually a bad thing to reinvent the wheel and i am certainly
not intending that. However, right now i really get the impression that i'm
better of making it all myself. Both approaches take many months of
development where the self made version is going to pay off in development
time in the long run when compared to magento. I am just not sure what the
best solution might be.

So here is a list of pros and cons that i can think of for both approaches.

Pros/Cons for using magento
- [pro] a lot of existing extensions
- [pro] i don't need to worry about security updates since the come from
magento
- [pro] living community around it to help out if there are any issues
- [con] very steep learning curve
- [con] not straightforward to start developing in
- [con] takes a lot of time till you can even use the basics

Pros/Cons for self made
- [pro] Development will go a lot faster
- [pro] i can make it more specific for one goal
- [pro] a much easier extension model
- [con] security all depends on me
- [con] i have to make complicated extensions like buckaroo and afterpay
myself
- [con] no existing library of extensions to use

Again, i'm puzzled by this. If i follow the #magento (on freenode) list
then i should pick magento, but make every extension myself or only use the
really good ones. Thus that will require a lot of time to develop them. I
'm guessing about half a year. Then again, if i make it all from the ground
up it's probably also going to take half a year to develop (or slightly
more) but it will obviously be much easier to maintain since i know every
single line of it.

What is your recommendation? Build it myself? Use Magento? or another
option that i didn't even consider yet?

Kind regards,
Mark


Re: [PHP] RAM Disk

2012-10-22 Thread ??????
I have use RAM DISK in IIS7.5 and MYSQL. 


PHP and MYSQL working in RAM DISK.  faster... 


-- Original --
From:  "Camilo Sperberg";
Date:  Mon, Oct 22, 2012 04:47 PM
To:  "Alan Hoffmeister"; 
Cc:  "php-general"; 
Subject:  Re: [PHP] RAM Disk




On 22 okt. 2012, at 04:45, Alan Hoffmeister  wrote:

> Hello fellows.
> Have anyone already tested PHP inside RAM disk with some Apache/nginx
> accessing those files or even session files?
> It's just for curiosity and performance analysis.
> 
> Thanks.
> 
> 
> -- 
> --
> Att,
> Alan Hoffmeister

I have not tested it but I think it wouldn't be much difference respecting APC 
for example, maybe a tiny little bit faster reading sessions and other file 
stuff because RAM have really small access times, but database connections and 
stuff would still be your main bottleneck (I'm assuming you do).

I would install APC and set /tmp up into a RAM disc, mainly because not only do 
MySQL write temporary files into /tmp (example: if MySQL decides to create a 
temporary table which would be with almost any grouping you do), also apache 
does and, if you haven't setted up the session routes, sessions will also write 
itself to /tmp. Plus, if your machine happens to suddenly reboot, you won't 
lose any important stuff.

Getting /var/log/ into an SSD or RAM disk should help too, but again: if 
reliability is important to you, I wouldn't do that. 

Greetings.
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] RAM Disk

2012-10-22 Thread Camilo Sperberg

On 22 okt. 2012, at 04:45, Alan Hoffmeister  wrote:

> Hello fellows.
> Have anyone already tested PHP inside RAM disk with some Apache/nginx
> accessing those files or even session files?
> It's just for curiosity and performance analysis.
> 
> Thanks.
> 
> 
> -- 
> --
> Att,
> Alan Hoffmeister

I have not tested it but I think it wouldn't be much difference respecting APC 
for example, maybe a tiny little bit faster reading sessions and other file 
stuff because RAM have really small access times, but database connections and 
stuff would still be your main bottleneck (I'm assuming you do).

I would install APC and set /tmp up into a RAM disc, mainly because not only do 
MySQL write temporary files into /tmp (example: if MySQL decides to create a 
temporary table which would be with almost any grouping you do), also apache 
does and, if you haven't setted up the session routes, sessions will also write 
itself to /tmp. Plus, if your machine happens to suddenly reboot, you won't 
lose any important stuff.

Getting /var/log/ into an SSD or RAM disk should help too, but again: if 
reliability is important to you, I wouldn't do that. 

Greetings.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php