laravel vagrant setup problems with encoding - php

I'm getting this error
after trying to run vagrant box add laravel/homestead.
I have followed almost all tutorials how to fix it but it didn't help..
I'm using windows 8.1(x64), and I have special characters inside the name of my user account(á,š) but I haven't installed anything inside the folder with some "special" characters.
Thanks for any ideas

I'd suggest telling Vagrant to use a folder other than your User's home folder to store downloaded boxes.
You can do this by setting the VAGRANT_HOME environment variable. For instance I have it set to E:/vagrant/data.

Related

PHP script not looking in includes folder

I have a new install. Ubuntu 22.04, Apache2, PHP 8.1 and I'm trying to use PHPMailer. My test page with phpinfo all looks good and shows the includes directory /usr/share/php. My form and script are in a subfolder of my document root and it loads fine. But when I fill out the form and the script starts it errors out unable to find PHPMailer. It's only looking in the subfolder the script is in, not the global includes directory. I don't want to put the mod in every form folder and I know it's supposed to work from the includes folder. Is this an Apache or php config issue? Or something I have to specify in the vhost?
Just verifying and closing out with the answer
I found the issue early today. Thanks to bad/tired eyes, I wasn't seeing the leading dot so it was looking for ./usr... Once i fixed that i was able to sort out the Ubuntu method of calling it from the libphp-phpmailer pkg autoload.php. I was able to get the script working with a few code corrections. The only thing I didn't sort out was PHPMailer:ParseAdresses but i only had a few recipients for this form so it wasn't that big an issue. My form is back online and my managers are happy 😊

which is the environment variables route for cakephp 3?

I recently installed a cakephp with composer to learn about framework use, and trying the bookmarks tutorial, but I get stucked in the checking your installation where you have to open the command line AKA cmd, and writing bin\cake.
It replies back: the system cannot find the path specified.
I've seen some information about how to set up the path variables but I'm guessing it's for version 2+ because apparently the cakephp 3 doesn't have a LIB folder like such:
YOUR_CAKE_DIR/lib/Cake/Console/
Any ideas on how to fix this?
Thanks
best regards!
***************UPDATE**********************
well, I've finally fixed the problem, the path I used for the cakePHP 3 instalation was:
c:\xampp\htdocs\caketest\bin
so I assume that If you aren't using xampp, it should point at the end to: cakeinstallation\bin...
my problem was that I always typed bin\cake but actually all I had to do was type only:
cake
you can read more information in here
bin\cake shouldn't require any special path settings other than being in the correct directory. However, you should make sure that php-cli is on your system's PATH. Depending on how you install PHP it could be in any number of places, but if php -v doesn't output the version of PHP you installed, you'll need to find where your installer put PHP and then setup the PATH environment variable.
With your example, AFAI remember the working directory they were executing cake binary was the parent of "bin" folder, in your case "caketest". I am talking without trying it (I dont have an environment close) you should use:
c:\xampp\htdocs\caketest> "bin/cake"
Watch the quotes. I think they are the main reason of that "the system cannot find the path specified."
I am supossing you are under windows (I saw xampp written in your post) and probably the xampp installation has already added the php folder in the PATH environment variable.

php is not recognized as an internal or external command using xampp

I am using xampp, so my php folder is in C:\xampp\php\ and I add in my PATH environment variables the C:\xampp\php\ but when I am running on cmd the php command I am getting the following message:
php is not recognized as an internal or external command.
Any idea what I am missing?
When adding an entry to environment variables make sure you leave no spaces between the semicolon and the new path.
I spent a couple of hours going over my steps until I realized that the only difference between other path entries and mine was a single empty space. So i changed it and tried again at the command window (no need to log off and back on) and it worked!
I realize this was asked a while ago but since I found myself looking for a solution i figured this might be helpful to other people too.
Here iam sharing some screenshot about adding Environment variables in windows 10 PC
Step 1
Open Control panel and search for environment variable.
Step 2
Select Environment variable.
Step 3
Select path that shown in the below image.
Step 4
click on edit button.
Step 5
Click new button.
Step 6
Add your php file path like given below.
Path may different according to your server.
Then click Ok that's It.
In latest Xampp, path to PHP.exe has changed to this. Means we will have to add this new path in our PATH environment as I mentioned at another Stackoverflow Question.
PHP.exe new Path in Xampp

FuelPHP "invalid data source name" error

I'm trying to set up a FuelPHP app, and I've run into a puzzling problem. Every time the app tries to connect to the database, I get the following error:
Fuel\Core\Database_Exception [ Error ]: invalid data source name
I've set FUEL_ENV to "stage" in Apache's VirtalHost configuration and the database credentials in fuel/app/config/staging/db.php seem to be correct: I can log in to PhpMyAdmin using the same username and password. I'm stumped as to what else to try - any advice would be much appreciated.
In case it helps, I'm using FuelPHP 1.4 on an Amazon EC2 instance running Ubuntu 12.04 LTS on which I've installed MySQL and PHP via apt-get. I have another app (on another instance) running an older version of FuelPHP (1.2.1) which runs with no problems.
Incidentally, this question is probably closely related to this one, but I'm asking it as a separate question because the problem I'm having is not limited to the command line.
Ok, this has taken far too long to get to the bottom of, but it turns out to be simple to fix: for some reason, in FuelPHP 1.4 the stage environment's config directory is called staging (in previous versions it was stage).
I don't know whether this is a directory naming mistake, or whether this is a new name and something somewhere in FuelPHP hasn't been updated to use it, but I found changing the directory's name to 'stage' fixed the problem.
I had the same issue when running unit tests with FuelPHP's oil utility. If you're running into this issue, it most likely is a configuration issue.
To debug, somewhere in the code that isn't working put something like the following to see what environment FuelPHP is trying to use:
<?php
echo "env: " . Fuel::$env;
exit;
In my case, it showed it was trying to use the 'Test' environment. Since I didn't have a 'test' folder in my app's config folder, it was failing.
In most versions of FuelPHP, however you have the Fuel::$env set in your .htaccess file will work throughout all versions of FuelPHP. However in older versions, you may run into this issue.
You can either edit the bootstrap.php file and manually set the FuelPHP environment how you want, or setup the environment that it's trying to use.
Apache web server: SetEnv FUEL_ENV DEVELOPMENT Hope this helps someone
For those of you who none of this worked make sure of two things
there are multiple db.php files /fuel/app/config/development/db.php. check environment as #Chad Hutchins mentioned and double check the username and password is correct
Make sure /var/mysql/mysql.sock exists. In my case I was using /Applications/XAMPP/xamppfiles/var/mysql/mysql.sock so i needed to create a symlink. Followed the instructions here
Hope that helps someone

Symfony2 permission issue in OSX local environment

I wanted to try out the local apache environment that comes with OSX Mountain Lion.
I did the basic setup and placed a project in the root directory
/Library/WebServer/Documents/
Jumped over too localhost in my browser and everything was working as expected.
However I then decided to follow this guide in order to use the Sites folder in my home directory, for simplicity sake.
http://osxdaily.com/2012/09/02/start-apache-web-server-mac-os-x/
I then reset apache and added this to my browser
http://127.0.0.1/~bengibson/PracTest/
The browser shows a list of a few of the files and directories in the project folder but not all of them :S.
I tried to navigate to one of the missing folders
http://127.0.0.1/~bengibson/PracTest/web/app_dev.php
But I get a forbidden message :(
Anyone know what this needs?
Just for reference here is the project folder
Heres the detailed view in of the folder in terminal
And here is what shown in the browser
I ran into this problem before on OS X when I downloaded the archive file for the Symfony 2 Standard Edition directly in the browser.
The # symbol at the end of the permissions table indicates that the file has additional attributes.
You can see these additional attributes by typing the following command in Terminal as an example, explained here.
$ xattr -l ~/Sites/PracTest/web/app_dev.php
The result returned is com.apple.quarantine.
This is the way OS X protects potentially malicious files downloaded from the internet from being readily available, which is why in Finder you get the warning box alerting you about opening a file downloaded from the internet.
In your case, to remove these extended attributes, run
$ xattr -rd com.apple.quarantine ~/Sites/PracTest
IF you wanted to know what this command does:
The -d flag removes the extended attribute specified after it, followed by the path.
The -r flag acts recursively, on all subfolders and files.
You should now be able to access both app.php and app_dev.php in the browser.
I'd also like to take the opportunity to recommend creating a new Symfony2 project with Composer rather than downloading it directly. It's hard to look back.
For anyone else who may happen on this blog, I had a similar issue and after a bit of looking around I found that I had forgotten the 'FollowSymLinks' Option in the username.conf file
sounds like permissions.
right click folder, get info, unlock with admin password bottom right and make all users able to read and write. then click the gear looking menu below it and tell it to apply to all contents within as well.

Categories