Intalling PECL APC on ubuntu and dreamhost hosting - php

Basically My aim is to use the following script on my website
php-upload-progress-bar
I want to first of all set it up on my local server which is on ubuntu 10.04 and i am using xampp1.7.7 and then upload it on my website which is hosted by dreamhost web hosting which uses php5.2
The main requirement of above script is to have APC .
My problem is that i am unable to set up APC on both server (my local and on dreamhost)
I have followed many tutorials to install it but coudn't install it
Can someone give me some idea about using APC and installing it to run above script??
I have already followed following tutorials and guides
Dreamhost wiki
Stack answer
PS;I am not using apache2 service.my php path is /opt/lampp/htocs
Please help me i am stuck in this and also i am using that upload script because i can not use flash,html5 or php5.3 acording to client requirement so i need a solution for upload progress bar using APC so that it will run in all browser and with php5.2
Thanks in advance

Please feel free to contact DreamHost support for more immediate assistance. As for the APC extension, it is not enabled on our php 5.2 or php 5.3 options, as you mentioned. The easiest way to do this will likely be to compile the apc module for php 5.3 and then setup the custom phprc file for it under your user. This wiki details the process:
http://wiki.dreamhost.com/PHP.ini#Compiling_PHP_5.3_extensions
-- I tested doing a install right now, the steps were:
Download the APC package from PECL: http://pecl.php.net/package/APC
extract it, enter the directory, run phpize, then run:
./configure --with-php-config=/usr/local/php53/bin/php-config
then make
mkdir -p ~/.php/5.3
cp modules/apc.so ~/.php/5.3
then edit the file ~/.php/5.3 and put into it:
extension=/home/USER/.php/5.3/apc.so
(replacing USER with your real ssh username)
save it, and you should be good to go.
Feel free to write us at support if you have any additional questions.

Related

Code only works if I use the Xdebug extension

When I started my latest project I learned how to use the xdebug extension and I have been using it ever since. Now I am ready to spin up a server and go in to production with this project and my site doesn't fully work. The frontend pages seem to work, which are php based as well, but the backend endpoints that query the database and return some data to the frontend always are returning a 500 status code. So I attach xdebug and figure out how to run it remotely and the pages all start working without any code changes. I go in to the php.ini file and turn it back off and the pages continue to work. Since this is an AWS EC2 server, I delete the instance and create a new one running the same initialization scripts I wrote to install all the software and I get the exact same issue. The server doesn't work until I follow the xdebug install instructions and restart apache2. And like before even when I unattach the xdebug extension via the php.ini file, the code continues to work. Even after the system is rebooted it still continues to work so whatever is being fixed appears to be permanent.
What would building and attaching the xdebug extension, and restarting Apache2, do to the a LAMP stack that would make my code work, even after the extension has been turned off? My server is being built with scripts that run various apt-get install commands with no binaries provided by me as it all is community provided programs. Like clockwork it breaks every time I rebuild the machine until I apply the extension. I can automate that in to my build scripts if I have to, but it is driving me a bit nuts that I don't understand what is happening.
When the server sends a 500 error, normally you get an entry to the php_error.log. So first check this file. Maybe there is some difference in memory limits, max. post variables etc.
I would suggest you to try to find calls of any xdebug specific functions such as var_dump() or any prefixed by xdebug_ in your code:
https://xdebug.org/docs/all_functions
What would building and attaching the xdebug extension, and restarting Apache2, do to the a LAMP stack that would make my code work, even after the extension has been turned off?
Installing one piece of software can bring with it another. If you sudo apt install php-xdebug without php installed, it will install php.

PHP PECL extension V8Js on Openshift Online

I need Openshift Online to get the PHP PECL extension V8Js running for letting React.js execute server side Javascript from PHP. Are PECL extensions now enabled? If yes, how can I do that? The last I saw was a feature request for this from 02.2014. But I did not get information if in the meantime something has changed.
25.07.2015: I'm a step further. Corey pointed me to a promising direction. Did not know, that PECL is some kind of PEAR. Both seem compatible to openshift. I added 'v8js' to the .openshift/pear.txt file and when git pushing the app the console talked to me. I tried to install v8js with 'pecl install channel://pecl.php.net/v8js-0.2.0' but the compiler could not find V8, console said:
checking for V8 Javascript Engine... yes, shared
checking for V8 files in default path... not found
configure: error: Please reinstall the v8 distribution
So, how do I find the path to V8, and how do I know, if it is already there? If not there, how do I get it?
26.07.2015: Did not manage to install V8. I tried to do it like described in the Google docs. The compilation takes 600MB! and I am running out of quota. Maybe I may need to upgrade python version too, since the depot_tools require a more recent version. So, this is very complicated right now. I am asking myself, if I am on the right track. I would still prefer the mainstream PHP way with V8Js for serverside Javascript instead of node.js.
What shall I do? another shared hosting (search hard)? Cloud hosting, like bitnami and Amazon AWS? Is there still hope with openshift? Virtual, managed server? I am confused.
Have you tried reading through the section of the Developer Portal about PHP cartridge dependencies? https://developers.openshift.com/en/php-getting-started.html#step3
The Openshift Online support immediately answered my question: "Sorry, we do not have the V8Js PECL extension at this time".
But from the hints of corey112358 and N.B. and own experience and from internet research I additionally learned that it's a hassle to make that extension run or find hosting support, if you are not a Google engineer who can install v8 or if you have no time or money to run an own server or if you are no expert in V8Js. So, in this case, you may find node.js a more comfortable solution.

Why Custom php install is needed to install APC

I don't know it is the right place to ask this question but still for me it is the best place to ask question so i am asking this
"My Aim is to install alternative php cache (apc) on my website (hosted by dreamhost) "
My problem is it is not installing by following the wiki http://wiki.dreamhost.com/Pecl_APC .That wiki clearly specified that i need to run a custom php install in order to install APC but whyy?? isn't there a way to install APC in existing php version .My site uses php 5.2.17. Please help me i am stuck into this from a very long time now.The dreamhost wiki is not helpful at all i need answer from someone who has installed APC on their server please help
thanks in advance
I guess you need to install a custom PHP because APC is a plugin that to configure needs compiling with PHP. So I guess dream host do not want to give you access to the default installation.
Did you try installing the custom PHP?
What error have you come across?

Installing PHP in IIS 5.1

I know there have been some similar questions to this, but they haven't helped me.
I'm trying to install Wordpress 2.8.4 on my XP box, with IIS 5.1. I installed MySQL, and found that it was possible to install Wordpress through the Microsoft Web Platform Installer. After installing Wordpress (the install worked fine), I proceeded to the next step in the Wordpress installation documentation, which is to open wp-admin/install.php in your browser. IIS seemed to not be interpreting PHP, and when searching for the best way to install it, I saw that it is also available with Microsoft Web Platform Installer, so I installed it that way. However, my IIS isn't interpreting PHP still. I do not know what the problem is, but I'm going to reboot right now and see if that helps, as I didn't reboot after the install (even though it didn't say I have to). Any help would be greatly appreciated. Thanks!
Application mapping for .php extension to x:\php5\php-cgi.exe is needed.
Open properties dialog box of IIS's Default Website, and perform extension mapping.

Best PHP download to keep all my options open?

In the past, I used WAMPserver on windows to parse PHP for me. This is a pre-configured package, focussed on working with MySQL.
When I tried to run PostgreSQL, I got error messages that said that my version of PHP wasn't compiled to work with PostgreSQL.
So, I've recently uninstalled WAMP and every associated with it. I've downloaded Apache 2.2.11 with openSSL, installed as admin(you know, run the command prompt as administrator, cd to the directory where the download was done and have it executed, so the install was done as admin).
That's that. I now have Apache installed, "it works" shows up, so I'm that far.
Now I'm wondering, do I download the exe and install, or the zip, or something else.
What is the best thing to do to make sure that the PHP on my system can handle everything I can ever throw at it?
Also, PHP first, or MySQL/Postgre first.
And lastly, what about PEAR? I need PEAR installed, which isn't standard on Windows. I'm guessing the pear.bat file in the PHP downloads will do that for me?
EDIT: I see one close vote, yet no comment as to why. It makes me wonder how people who are so lazy and rude got to have somany points.
I would recommend downloading the zip package, as configuring php is not really that difficult, and it allows you to add features as needed.
As for whether first to install php or MySQL/PostgreSQL, - it does not really matter. You can install them in any order.
Your guess regarding PEAR is quite correct
i haven't used wamp before, so i can't comment on that
i do however use xampp which sounds very similar
in xampp if i want to enable postgres support i edit the php.ini file and uncomment the postgres section of the ini file, same with any of the extensions that i need
perhaps this might be an alternative you can try if you get stuck
There are many ways to setup a HTTP server/PHP/database machine. Sometimes the behaviour of your development setup will differ from the live server's.
I would recommend finding out the setup your web host is using, then getting a vmware appliance image that fits that as close as possible and get any additional software using it's package manager (which is easier that installing stuff on Windows).
Setup a file sharing link between the VM and the host, make sure you can view the VM's port 80 in a browser running in your host OS and you're set.

Categories