Php search path


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Php search path
# 1  
Old 08-22-2018
Php search path

Probably simple, but I don't see it.
Code:
jack@veritron /u/email $ cat p3.php
<?php
require_once './lib/swift_required.php';
$x=get_include_path();
echo "$x \n";
set_include_path('./lib:./lib/classes:'.$x);
$x=get_include_path();
echo "$x \n";
$transport = SmtpTransport::newInstance('smtp.postmarkapp.com',587)
    ->setUsername('abcdefghijkl')
    ->setPassword('abcdefghijkl')
;
echo "line 4\n";
?>
jack@veritron /u/email $ php ./p3.php
.:/usr/local/lib/php 
./lib:./lib/classes:.:/usr/local/lib/php 

Fatal error: Uncaught Error: Class 'SmtpTransport' not found in /u/email/p3.php:8
Stack trace:
#0 {main}
  thrown in /u/email/p3.php on line 8
jack@veritron /u/email $ find ./ -name SmtpTransport.php -print
./SmtpTransport.php
./lib/classes/Swift/SmtpTransport.php
./classes/Swift/SmtpTransport.php
jack@veritron /u/email $

# 2  
Old 08-22-2018
I don't know php, but maybe
Code:
set_include_path('./lib:./lib/classes:./lib/classes/Swift:' . $x);

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Gcc linker search path order

I have a build where I wish to link against and load a specific version of a library and a different version of the same library is installed on the system. I'm using a -L option to point to the version that I wish to link against but gcc still seems to choose the installed version. Is there a way... (4 Replies)
Discussion started by: Richard Johnson
4 Replies

2. UNIX for Dummies Questions & Answers

How to add to the search path - bin?

Hi, Now I have: /Users/okn/bin for my private shell scripts. How do I add /Users/okn/bin to my PATH? The PATH is right now: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin The .bash_profile doesn't state anything about a PATH (yet). I read about this: PATH=/bin:$PATH
 export PATH or... (1 Reply)
Discussion started by: OmarKN
1 Replies

3. Shell Programming and Scripting

Conduct a search or test -f over a path with spaces

I am organizing my music library on a NAS server. I want to print a list of all the directories that are missing the cover art (at least one or more jpeg file). I have successfully created a file with each line containing the path to each occurance of one or more .mp3 files. That path is also... (2 Replies)
Discussion started by: godfreydanials
2 Replies

4. Shell Programming and Scripting

How to select the shortest path in grep search?

Hi, How can I display only one shortest path (A/B/configure)? $ grep configure file.txt A/B/configure A/B/C/configure A/B/C/D/configure Thank you. (9 Replies)
Discussion started by: hce
9 Replies

5. Emergency UNIX and Linux Support

Migration of website... PHP/Mysql -which path for DB.php

Hi, I have two websites: website1.com and website2.com I didn't write either but have successfully moved all the files from website1.com to website2.com I (thought) I installed all the correct php modules and website2 is mostly up and running. However, my boss found that when we go to a... (15 Replies)
Discussion started by: Astrocloud
15 Replies

6. Shell Programming and Scripting

How to search/replace a directory path in a file using perl

Hello All, Here is what I am trying to do and maybe you guys can point me in the right direction. I have a file that contains the following string(s): WARNING: </d1/test/program1> did not find item1 WARNING: </d1/test/program1> item1 does not exist WARNING: </d1/test/program2> item1 failed... (1 Reply)
Discussion started by: maxshop
1 Replies

7. Shell Programming and Scripting

How to find duplicate commands in the search path?

I wanted to see if there is any duplicate of a specific command in the command search path. The following code will list all copies of "openssl" in the command search path. find `printenv PATH | sed "s/:/ /g"` -maxdepth 1 -name openssl However, the above code would fail if the search path... (9 Replies)
Discussion started by: LessNux
9 Replies

8. Shell Programming and Scripting

PATH dircetory search order

Hello I using CygWin and am working on project that requires whereby after I make some code changes and rebuild I have to manually copy the updated files into the install directory to test them. There is a build output directory where these files placed, but the program will not run from there.... (4 Replies)
Discussion started by: bobban
4 Replies

9. UNIX for Dummies Questions & Answers

Adding default search path for CPP

Hi there, I have built myself a GCC (3.4.4) for PowerPC with a cross compilation toolchain running on a x86, together with glibc-2.3.4 and binutils-2.16. On the PowerPC there is a system runnign already (only console ofc, nothing "cosy", kernel-2.6.15). So my question is how to propperly... (1 Reply)
Discussion started by: boyanov
1 Replies

10. UNIX for Dummies Questions & Answers

home directory in search path

Is it unsafe to put your own home directory (a regular user) in your search path? I am writing useful shell scripts, but don't have the permissions to put them in /usr/bin. (Korn shell) thanks (2 Replies)
Discussion started by: jpprial
2 Replies
Login or Register to Ask a Question