I am not a Pro at server side scripting so here goes one small problem I am having and hopefully someone out there will be able to point me in the right direction.
I am transferring a site to a new shared hosting in Godaddy. In the process installatron didn't migrate correctly so I had to pick up where it left off and manually did the rest. After checking the PHP info I noticed that the MySQL Extension is not installed.
I did some research online and came up with this code to create an installation of the extension. My only problem is that I do not know where to add this code.
# apt-get install php5-mysqlnd
Do I add it to my php.ini file? do I input this through my cmd prompt? or Do I add it to my htaccess file?
I thought the CMD was the proper way to go but I don't mess around with CMD too often so I am slowly getting better at it.
Is this the proper way to go?
Do I use the same credentials to log in via CMD as FTP, cPanel or ???
Thank you for your constructive inputs.
Related
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.
I think I'm having the same issue as this link: Apache is downloading php files instead of displaying them
I'm trying to install Roundcube on my Linode server but when I go to www.myurl.com/roundcube it downloads the php files.
I read through that link and I see people saying to add things to different files, but I don't know where to look.
I'm new to Linode, I'm used to hosts with cPanels and such. So, I need a bit of a point in the right direction.
With linode you have the raw server ie you need to ssh into it and configure it. Start with this guide.
https://www.linode.com/docs/websites/hosting-a-website
Once you have a basic site running then configure apache to use 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.
I create php application for small businesses. Some of the clients may prefer running the app on a local server, therefore my requirement is to create/bundle an app with apache/mysql/php with all the necessary confirguration and one click executable (be it a batch file) such that when the user opens it, it runs the apache server on some port say localhost:1234 and mysql as well.
and opens up the application in the default web browser.
To be more exact, Im looking for something like http://www.simpleinvoices.org/go, check their Simple Invoices for Windows which come budled with apache/php/mysql.
P.S - Im not sure if this question should be at SO or Superuser.
If you actually want to install a web server and a SQL server then Lars' solution would be a way to go. On windows you can generate a .msi installer containing the dependencies you need (like WAMP). An installer executable would be a cleaner solution than a batch file in my opinion, as it will also provide the user with an option to uninstall your software if they wish.
If you want to distribute your application in a standalone version, then you might also want to check a solution like NuSphere's PHPDock - http://www.nusphere.com/products/phpdock.htm
I had the same challenge and came across Uniform Server:
http://www.uniformserver.com/
You download it, add your application to it, start it and everything runs. Lovely.
Superuser would have been better. But depending on your requirements, you should just create a package to install. On windows, package it with WAMP, on linux, package it with either one-click-install or creating packages for the two biggest systems, namely APT and RPM. With the dependency-system on all of them you can make sure, that your application runs right off the bat.
PHP Desktop is the best option I found when researching this.
https://github.com/cztomczak/phpdesktop
PHP Nightrain is also an option:
https://download.cnet.com/PHP-Nightrain/3000-10248_4-76169308.html
Bitnami WAMP stack looks good as well:
https://docs.bitnami.com/installer/infrastructure/wamp/
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.