Running the development web server google app engine for php - php

Where can I write the following command
i am following the developer tutorial for simple hello world script here
google_appengine/dev_appserver.py --php_executable_path=pathto-php-cgi path-to-your-app
When I run application in google app launcher I get a error message . I have WAMP install and it is running fine.
The path specified with the --php_exectuable_path flag () does not exist.
Php path - c:\php\php-cgi.exe

I also met this problem, and it has been solved.
for example,
if your PHP folder is E:/sam/php/
if your PHP site folder is F:/mysite/facebook/
if your dev_appserver.py is under E:/whatever/
I'm not sure how to change googleapplauncher.exe configurations, instead, you have to use cmd instead. I think this exe has config files but I did not find it. Open the command window and go to folder E:/whatever/ to run "python" command under this folder.
Type in:
python dev_appserver.py --php_executable_path=E:/sam/php/php-cgi.exe F:/mysite/facebook/
NOTE: REMEMBER to type "php-cgi.exe"
use slash

I dont know which is the name of the file in Windows, but i just have that problem, the full path from / for your php-cgi54.exe including the fullname of the file and then the full path from / of your folder.
I also run it like admin so check if your cmd or terminal was open with admin rights.

#Chander if you have wamp running you need to select a different listening port for app engine by typing the command: --port=9999 for example.
Here's what worked for me:
Open your cmd, make sure you're in the same directory as your sdk.
Type: "google_appengine/dev_appserver.py" --port=9999 --php_executable_path="fullpath\php-cgi.exe" "helloworld/"
If you have another local server like xampp or wamp,make sure you use the --port command to select another listening port as shown above.
Press enter and you should have your helloworld script working.

Related

Run laravel project in localhost

I have installed laravel by composer create-project laravel/laravel –-prefer-dist
after this run php artisan serve command to laravel project directory and get this result.
Laravel development server started: http://127.0.0.1:8000
But when i go to http://127.0.0.1:8000 in browser laravel project not running and give error
This site can’t be reached
127.0.0.1 refused to connect.
but http://localhost/laravel/public/ it is working. Can anyone tell me that what is proper way to run this laravel project.
Try to run in different port
php artisan serve --port=9000
and then try http://127.0.0.1:9000 will work.
As might be on port 8000 something already running on your system will not make it work.
And you can also run your laravel project without artisan serve command
If anyone wants to make the application public, the more easy and fastest way is:
Rename the "server.php" file in root directory, in "index.php"
Move your .htaccess from public folder to root directory
Make your directory accessible to Apache2 (set all file permissions
to 777).
At starting level, you can use url like this http://127.0.0.1:8000 with port-number. but in further level you must working with simple url like http://localhost/laravel/public/.
One more thing - you should remove "public" keyword from url, so you access direct your root-project. Review this link - Laravel 5 - Remove public from URL
I had that problem too! And couldn't solve it. So I installed openserver from https://ospanel.io/ and put my site on the folder domains (Windows 10), then I just start Open Server and click "My Sites" and choose my site - it opened in my browser which set by default on Open Server program and click the folder on my browser cooled "public" and there you go -> your site is working.
I now that isn't solve the problem with cmd and start thought cmd and server like http://127.0.0.1:8000, but you can take access to your local site through http://'your site'/public/'your pages'
Good luck!
Changing the port will help.
php artisan serve --port=9000
worked for me
Try this
php -S 127.0.0.2:8000 -t public/
It will start your local development to http://127.0.0.2:8000 which will work great.
OR
You can try instead
php -S 127.0.0.1:8000 -t public/ It will work in any browser as compare to command php artisan serve which open url http://127.0.0.1:8000.
Successfully landed to Laravel page by the following steps.
Note: This is after the successful installation and configuration.
Was in /var/www/html/
Created the project using the following command after Laravel installation successfully
$laravel new firstapp
here firstapp is my project
cd to firstapp (folder created with project creation with $laravel new firstapp)
serve using the following command
$ php artisan serve
The project ready to serve with the following statement as below
Laravel development server started: http://127.0.0.1:8000
You can access the laravel page using the following URL
http:///firstapp/public/
Sometimes this occur when you have installed an anti virus software. Anti-virus deleting your "server.php" file. For that you can create an exception in anti-virus for "server.php" file or creating a "server.php". You can find relevant code for the file searching. Basically server refuse to connect occurs when the "server.php" deleted or removed from the file path.

'mysqldump' is not recognized as an internal or external command

currently im trying to make backup and restore mysql database in my laravel project. I am using this laravel package https://github.com/backup-manager/laravel for backup package. i already follow the intructions, but when i am trying to backup my local database through command line (php artisan db:backup) in the last question, i got this message.
Dumping database and uploading...
[BackupManager\ShellProcessing\ShellProcessFailed]
'mysqldump' is not recognized as an internal or external command,
operable program or batch file.
I already googling it, and already put C:\xampp\mysql\bin to my windows env variables paths, but i still having this issue. if anybody know how to fix this, please tell me, i really appreciate it.
Laravel 5.1.x
It is because mysqldump.exe is not found in that location, the right path is given bellow
Open Command Prompt and type this
cd C:\Program Files (x86)\MySQL\MySQL Server 5.5\bin
Press Enter
then type
mysqldump.exe
or,
Directly open this directory "C:\Program Files (x86)\MySQL\MySQL Server 5.5\bin" and Press LEFT SHIFT KEY from keyboard and RIGHT CLICK on the Directory Window.
then type
mysqldump.exe
It will work 100% correctly
If you are using Xamp then:
Open your Xamp folder
Go to \mysql\bin find the mysqldump.exe
Go to your environment variables under System variable click on 'New'.
As 'variable name' put 'mysqldump'(without the quotes) and as 'variable value' put the path to your xamp\mysql\bin\mysqldump.exe this will make 'mysqldump' available as a global system alias.
Reminder: Make sure to restart your command-line interface.
It happened with me and I solved it by adding the following line at the top of the .bat file.
cd "C:\xampp\mysql\bin"
Please add C:\xampp\mysql\bin to this path at your user variables and system variables. If you are using a wamp server, add C:\wamp64\bin\mysql\mysql8.0.27\bin this path at your user and system variables.
Note: MySQL version path will change as per your installation.
On my side, I was using PowerShell and I had the same error message.
I had to go inside the directory of MySql. Mine was located in:
C:\Program Files\MySQL\MySQL Server 5.7\bin
Then I had to make sure that I had mysqldump.exe in the bin folder.
And then run this command:
./mysqldump.exe -u root -p yordbName > C:\MySqlDump\sakila.sql
It is late, but I will answer to this question for other people who have the same issue.
You need to add the mysqldump.exe runtime file path to your Windows environment variable. I am using Wamp, the path look like this "C:\wamp64\bin\mysql\mysqlx.x.xx\bin"
Close your command-line interface and try again, It should work.
I am using Xamp and the following step is working:
Copy the path "C:\xampp\mysql\bin"
Go to your environment variables under System variable click on 'Path' and add "New".
Put the path there then click ok.
Restart your command-line interface.

Command 'php' not recognized but it is registered in Windows PATH

I have "C:\Ampps\php" setup in the PATH string on my Windows server but when I type 'php' on the PHPStorm terminal I'm always given 'php' is not recognized as an internal or external command, operable program or batch file.
Is this a bug with PHPStorm 7.1.3? It works from the command line if I open a new Command Prompt window externally.
For any new readers facing such problem in PhpStrom just set path directly from PhpStrom terminal
set path=%path%;c:/xammps/PHP
Not recommended to use PHP from xammps or other such programs since it will be your working PHP directory and if it gets deleted then you have to perform another task to handle it or some errors might pop up in windows just install a fresh version of PHP lots of tutorials are out there for Windows.
But nevertheless to use PHP in PhpStrom Terminal from xammps just run that command it will set the path that PhpStrom can find.
I had the same problem. I have "C:\__OPENSERVER__\modules\php\PHP-7.2-x64" setup in the PATH.
To solve it I added in PhpStrom terminal and executed:
set path=%path%;C:\__OPENSERVER__\modules\php\PHP-7.2-x64
open setting in file menu
find tools tab in this window
click on terminal
in project setting click on environment variable
add php path (for example "C:/xampp/php") to this and save
restart phpstorm

Run a .php script on my website from command line

I have been searching for an answer to this for a couple of hours with no clear answer.
I normally write .php scripts which do helpful administrative tasks on my website. I upload them to an ftp folder, and run them from my browser when I need them.
Unlike what I a used to, I am trying to run a script (someone else wrote it) to and have been told that I cannot do so from the browser and I need to do it from the command line. Basically everything is set up, but I cannot push to go button and run the script.
Any ideas? I have php installed on my local computer and can run scripts locally from browser and command line, but I do not know how to do the same for the scripts on my website.
I don't know if this helps, but my server is apache and runs off php version 5.3.3
Download Putty, from http://www.putty.org/
Run it
In "host" write your domain, and click on Open
When the black window open, it will ask you for your credentials:
Write your ssh credentials, if you have. If you dont, try with the ftp user and password.
If it doesn't work...get into your host control panel, and find out how to create an SFTP, or SSH user. If you can't find anything, contact support asking how to create that kind of user. When you have it
After you login, your are inside your server, and you can move around, as you would in linux. If you dont know the basics, find a good tutorial. Or just relay in:
ls : list the files and directories
pwd : know in what directory you are
cd DIRNAME : change to other directory inside de current one
cd .. : change to the parent directory
When you are in the directory where your script lives, just execute:
php yourscrip.php
if its a php script
php path_to_script.php
else
/path/to/script
If its the second option you will need to chmod +x /path/to/script first
These should all be run from a ssh session (or any other way of accessing a command line on the machine running the website)
to ssh to a sever use putty if on windows. Your host will be able to give extra details on how to access

‘php.exe’ is not recognized as an internal or external command, operable program or batch file

‘php.exe’ is not recognized as an internal or external command,
operable program or batch file.
Why does that error occur even though I've added PHP to my environment variables?
My environment variable PATH is shown below:
C:\Program Files\NVIDIA Corporation\PhysX\Common;C:\Program
Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files\PC
...............
Files\QTSystem\;A:\xampp\php\php.exe
I'm using Windows 7.
A:\xampp\php\php.exe
The PATH environment variable must contain paths only, not file names.
Make that
A:\xampp\php
it is very easy to do
You need to also add php.exe
Adding this path:
windows key + pause
click on Advance system settings
click Environment Variable
System variables part -> Path -> Edit and the add
C:\wamp\bin\php\php5.3.8;
close you cmd prompt if its open
It's Done!
I think you need to change it to A:\xampp\php\ and just leave it there, then it will search the directory for the file, also: have you tried calling just php instead of php.exe and check that the directory is correct.
View above screen shot for setup enviroment variable in window 7
Note:- After setup enviroment variable please restart you computer then its will work fine
Shouldn't the last part be: C:\xampp\php\ ? Unless you remapped your drives, A is the floppy disk. :)
Also, you need to specify the folder, not the exe file itself.
My case am Using Bitnami Ruby Stack apache Web server ,
Pressed Windows key + Pause/Break Button
Clicked advanced system settings
Click Environment Variables
Under System variables > edit PATH variable by adding C:\Bitnami\rubystack-1.9.3-24\php
Click Ok to close the Environment Variable window
Close your command prompt if open
*(Proceed to 7. to confirm if php is installed)
Press Windows Key + R button to open your cmd
Type php -v to view your php version
Set PHP as environment variable from System as below to run it from CMD
1)Windows key + Pause
2)Click on Advanced system settings
3)Now click on Environment Variables.. button
4)In system variable section search for Path and edit it as D:\wamp\bin\php\php5.3.13;(If one needs to append it to some already exits value then start path with;)
5)Now open CMD and run command PHP from any path where you don’t have PHP installed , in my case it’s C drive.
6)We can check above set Path from CMD using Path command also.
If you have installed WAMP server, then your path can vary. For example, I installed WAMP and the path to my php.exe turned out to be:
C:\wamp\bin\php\php5.5.12\php.exe
To make it work, I entered the following path in the PATH variable of the System Variables:
C:\wamp\bin\php\php5.5.12
Once done, I restarted command prompt and everything worked fine.
So the path can vary depending upon how you installed PHP. If you would like to install WAMP server and have it install other essential packages like PHPMyAdmin, etc. you may do so from: wampserver.com
In my case, environment path is C:\ProgramData\Drush\;C:\Program Files (x86)\Drush\Php; and it works for me.
If I simply add C:\xampp\php\ dint work for me.
I hope if someone facing this issue can try this suggestion.
This happened to me and I found why.
Xampp can't run properly depending on your UAC settings.
Try to do this:
Log in as administrator (running cmd.exe as administrator isn't enough)
Execute cmd.exe or equivalent
type php -version

Categories