Here's the steps I took:
1)
2)
3)
For some reason I'm not able to figure out, this is not working. I'm a novice and I'm currently stuck here.
Any help will be much appreciated!
Thank you in advance,
Gabriel
you should consider installing apache webserver and setup the host file in your pc
Apache :
https://knowledgebase.progress.com/articles/Article/How-to-install-Apache-HTTP-Server-on-Windows-Server
Set Hosts file in win :
https://docs.serverpress.com/article/176-windows-10-and-localhost-is-blank
Create a new folder and then go to it in cmd using cd command. And move the file into it.
Then start the php server again and acces it using this link:
localhost:4000/site.php
Or install apache server as #mshahien said.
You can use xampp.
You are running php -S in the wrong directory.
The www directory is inside a directory called php somewhere inside your One Drive directory, but you are running php -S from a directory called i346241.
The server started by php -S takes the current directory to be the root of the development server.
Related
I have a .htaccess file in a php project, I have the apache2 server downloaded and running, but it ignores my project's .htaccess.
When I test the project on Windows or put it on my hosting it works normally.
I already tried to edit the apache2.conf file, among several other methods that I found to solve, and nothing worked, the project worked correctly on the computer of my friends who have linux.
I start the project with the command php -S localhost: 1990 inside the folder that has my files, I tried other ways and nothing worked.
Can someone help me? I've been looking for a long time and nothing has resolved.
I apologize for my English, I'm Brazilian and I still can't speak English very well.
I start the project with the command php -S localhost: 1990
This uses the webserver built-in to PHP, not Apache. Consequently, this does not use a .htaccess file (or apache2.conf).
You need to call your PHP files through Apache - which you say is already "running". (?)
(Aside: There should be no space between localhost: and 1990.)
Reference:
https://www.php.net/manual/en/features.commandline.webserver.php
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.
I am newbie to PHP programming and IIS. Somehow I managed to have my php application hosted on IIS server. I am able to perform all the data base transactions successfully. But now I am trying to run a batch file which is available in the root of IIS.
I have tried these two options below
$output=exec("C:\windows\system32\cmd.exe /c Start C:\inetpub\wwwroot\drupal\modules\batch\RunSuite.bat", $out);
cmd.exe is copied to the root folder before executing this line
$output=exec($_SERVER['DOCUMENT_ROOT']."\cmd.exe /c Start".$_SERVER['DOCUMENT_ROOT']."\drupal\modules\batch\RunSuite.bat", $out);
both of them do not work. Could you please help me to solve this issue? I am sure it is my ignorance :-(
First line of the above code works as expected, if we host the entire application using drupal locally and run it. I assume, it would be some configuration / permission issues, while triggering the batch as a service in IIS. Your help is really appreciated.
Thanks and Kind Regards
Anil
I have installed pdftk on my PC that I use for local development using XAMP. I have installed pdftk to my local directory. From the code bellow where should the file test.pdf be placed? I am getting fields.txt created in my websites root directory, but if I place text.pdf there I still get a blank fields.txt file generated. If I go into CMD and CD to my websites root directory and execute the code bellow I get the correct results. Any help would be very much appreciated.
exec("pdftk test.pdf dump_data_fields > fields.txt");
Turns out I just had to restart my PC... Should have known. I thought restarting Apache was enough I was very wrong. Everything works great now.
I am installing composer for laravel installation.but when it want php.exe file i coudn't find it in c:/xampp/php folder.I set up my path variable c:/xampp/php but it is still not working.help me guys.
If xampp has correctly installed, but you are failing to run PHP it is more than possible that you don't have PHP set in your environment paths.
To set this go to;
Start > right click computer > properties > Advanced system settings > Environment Variables.
Under System variables find a variable named PATH, highlight then click Edit... Append the absolute path to your root PHP folder, this could either be xampps located in.
c:/xampp/php/
Press Ok, once you've finished; close down any command prompt windows you may have open. Re-open command prompt and run php -v. Hopefully at this point PHP has responded with it's version and license information.
Make sure you have xampp properly installed.
If you add c:/xampp/php to your PATH while you have a console open, you need to open another console, in order for the PATH to be updated.
i think I have that problem one day, i solved uninstalling xampp server and reinstalling it, but when xampp ask you wich folder to install you need to create a new folder:
C://new folder/xampp/.......
If you install/uninstall multiples xampp or wampp versions for some reasons create storage info in the xampp folder, so creating a new folder solve the problem.
You can use this path:
c:/xampp/php/php.exe
PATH should be a directory, not a file, so you should set it to "c:\xampp\php\", other than"c:\xampp\php\php.exe"